Yahoo Clever wird am 4. Mai 2021 (Eastern Time, Zeitzone US-Ostküste) eingestellt. Ab dem 20. April 2021 (Eastern Time) ist die Website von Yahoo Clever nur noch im reinen Lesemodus verfügbar. Andere Yahoo Produkte oder Dienste oder Ihr Yahoo Account sind von diesen Änderungen nicht betroffen. Auf dieser Hilfeseite finden Sie weitere Informationen zur Einstellung von Yahoo Clever und dazu, wie Sie Ihre Daten herunterladen.
I need C Programming help please!?
So i need to have the user input a number and repeats until the user terminates the program by typing 0... then it's supposed to show that "The positive numbers of your ..numbers... are (whatever the user input).. The Sum.. etc."
my professor isn't really helpful and i'm trying to figure it out but I can't.
Your help is greatly appreciated.
3 Antworten
- Richard JLv 5vor 4 Jahren
You'll want to declare a sum value and set it to 0.
In an endless while loop have the user enter a number. Immediately check it.
if num == 0 break
else sum += num
Something like that...