Results 1 to 2 of 2

Thread: Differentiate between Do-While loop and While loop

  1. #1
    RussellBarnes is offline Senior Member
    Join Date
    Dec 2009
    Posts
    214
    Rep Power
    3

    Default Differentiate between Do-While loop and While loop

    I am not able to know what basic difference in between Do-While loop and While loop. How can we decide which loop will be proper for the particular test condition?

    Any suggestion???

  2. #2
    PetersonClark is offline Senior Member
    Join Date
    Dec 2009
    Posts
    202
    Rep Power
    3

    Default

    In a while loop the condition is first tested and if it returns true then it goes in the loop, In a do-while loop it enters the loop first and does the first iteration and then does the checking at the end.... If at the end in a do-while loop it returns true the second iteration follows, but if it returns false then it goes out of the loop...

Similar Threads

  1. outer loop in C
    By ashley_black in forum Programming
    Replies: 1
    Last Post: 03-12-2010, 12:05 PM
  2. Java for loop example
    By WilsonMartin in forum Programming
    Replies: 1
    Last Post: 02-10-2010, 01:12 PM
  3. loop to get particular pattern
    By FosterWood in forum Programming
    Replies: 1
    Last Post: 01-30-2010, 01:39 PM
  4. Problem in my loop
    By sara fisher in forum Programming
    Replies: 3
    Last Post: 10-21-2009, 12:03 PM
  5. using The Loop Function
    By jack879 in forum Everything Else
    Replies: 0
    Last Post: 11-17-2008, 12:45 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
SEO by SubmitEdge

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48