Thread: Simple program that wont execute

  1. #16
    novice fisheromen1031's Avatar
    Join Date
    Jul 2005
    Location
    Lone Star State/ Rocket City
    Posts
    13
    it would be easier to just put the initial gallons read in above the while loop and then again at the bottom of the loop before the close brace
    this would eliminate the need for break and for the extra comparison that quzah suggests

  2. #17
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    Exactly. "A million different ways to fix this problem."
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  3. #18
    Destoryer of Worlds
    Join Date
    Jul 2005
    Posts
    17
    haha quzah you crakin me up over here

    anyway ive done this program when learning C and belive me dont feel bad i really messed mine up worse then this. LOL but i wont put people here though my insanity

    somthing to bear in mind also dont try and enter a b or another char for any of your program otherwise it will spin into non ending loop of death or worse on a MS machine :P

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. [Help] Simple Array/Pointer Program
    By sandwater in forum C Programming
    Replies: 3
    Last Post: 03-30-2007, 02:42 PM
  2. simple silly program
    By verbity in forum C Programming
    Replies: 5
    Last Post: 12-19-2006, 06:06 PM
  3. Simple window program
    By baniakjr in forum C++ Programming
    Replies: 5
    Last Post: 03-11-2006, 03:46 PM
  4. Help with simple program
    By nik2007 in forum C++ Programming
    Replies: 4
    Last Post: 02-27-2006, 09:54 AM
  5. Need help on code to execute the program
    By hibmem10 in forum C++ Programming
    Replies: 6
    Last Post: 12-24-2005, 01:42 PM