Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

C Programming Tutorial - 6 - While Loops

Loading...

Sign in or sign up now!
91,683
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Feb 28, 2009

Part 7 - http://www.youtube.com/watch?v=z773Xu4-kIY

All of this code is FREE on my website http://thenewboston.com

Category:

Howto & Style

Tags:

License:

Standard YouTube License

Link to this comment:

Share to:

Top Comments

  • 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

  • 68,366 got done and dirty with Bucky; you slut

see all

All Comments (187)

Sign In or Sign Up now to post a comment!
  • 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?

View all Comments »
Loading...

0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more