Develop a program to ask the user to enter a number, if the user enters a positive integer, then calculate the sum of that natural number using do-while loop and display it on the screen. his program takes a positive integer from user ( suppose user entered n ) then, this program will displays the value of 1+2+3+....+n.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter5: Repetition Statements
Section5.5: A Closer Look: Loop Programming Techniques
Problem 13E
icon
Related questions
Question
Q#4: Develop a program to ask the user to enter a number, if the user enters a positive integer, then calculate the sum of that natural number using do-while loop and display it on the screen. his program takes a positive integer from user ( suppose user entered n ) then, this program will displays the value of 1+2+3+....+n.
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning