Thread: What is the fundamental difference between the do loop and the while loop?

  1. #1
    Registered User
    Join Date
    Feb 2006
    Posts
    33

    Question What is the fundamental difference between the do loop and the while loop?

    Question:

    What is the fundamental difference between the do loop and the while loop?

    Thanks

  2. #2
    Registered User Tonto's Avatar
    Join Date
    Jun 2005
    Location
    New York
    Posts
    1,465
    A do loop tests the condition after executing it the body initially. A while loop tests the condition before entering.

  3. #3
    ex-DECcie
    Join Date
    Dec 2005
    Posts
    125
    Quote Originally Posted by Tonto
    A do loop tests the condition after executing it the body initially. A while loop tests the condition before entering.
    So with a do-while loop, you're always guaranteed to execute the body of the loop at least once.
    Mr. Blonde: You ever listen to K-Billy's "Super Sounds of the Seventies" weekend? It's my personal favorite.

  4. #4
    Registered User
    Join Date
    Feb 2006
    Posts
    33
    Thank you That clears it up for me

Popular pages Recent additions subscribe to a feed