Write a c program that continue to sums up natural numbers as they are entered by a user print out the total only when zero is | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Write a c program that continue to sums up natural numbers as they are entered by a user print out the total only when zero is

13th Sep 2018, 11:57 PM
Hannah Joshua
2 Answers
+ 4
Hannah Joshua use cin for taking input into while loop.. loop should be ended when user enters 0... store summation of entered value in to a variable and print that variable out of while loop..
14th Sep 2018, 12:54 AM
Ketan Lalcheta
Ketan Lalcheta - avatar
+ 1
Ace I also thought c first.. checked profile of Hannah Joshua and observe that he is doing c++ course and hence changged from scanf to c++
14th Sep 2018, 10:22 AM
Ketan Lalcheta
Ketan Lalcheta - avatar