C Programming Tutorial - 6 - While Loops
Loading...
91,683
Top Comments
see all
All Comments (187)
-
i know the beginning and the end not there sorry...
-
a funny combo you can play whit. int loopcount; int hotdogs; int total; int average; int rounds; total = 0; loopcount = 0; printf("average of hours on the computer. how many days?\n"); scanf("%d", &rounds); printf("average of hours spent on the computer?\n"); while(loopcount < rounds) { printf("hours spent playing today:"); scanf("%d", &hotdogs); total = total + hotdogs; loopcount = loopcount + 1; } average = total/rounds; printf("You spend an average of %d hours a day\n", average);
-
@Ausamnco You forgot to include your header files , main function and getch(); Troll :) ( its a joke ) :P
-
@RonSerruya1 type cast your integers to doubles or floats first
-
I have a question , if i want that the average can be a not complete number
like 8.54 or 7.6 how do i do it?
i tried to do float average but it does alway avereage = 0
thank for helping :)
-
Thank you so much !
I succsed to learn loops in 10 min thanks to you ;]
great toturial :)
-
@yonchvader did you copy his code word for word?
-
It says "syntax error before int" and it did the same earlier when I used the "else" function. Whats wrong?
-
was 17?
Loading...



third from last line should be printf ("average number of dogs was ... right? i mean average instead of total but still very helpfull and nice vids thank you
sepia2008 3 months ago 11
68,366 got done and dirty with Bucky; you slut
NoamElBaZ 5 months ago in playlist TheNewBoston - C Programming 3