Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

while /do-while loop differences

Status
Not open for further replies.

sivamit

Full Member level 4
Joined
Dec 1, 2005
Messages
202
Helped
20
Reputation
40
Reaction score
14
Trophy points
1,298
Activity points
2,664
while /do-while loop

What are the differences between while loop and do-while loop..?



Thanks
 

drbizzarow

Advanced Member level 1
Joined
May 24, 2006
Messages
416
Helped
25
Reputation
50
Reaction score
15
Trophy points
1,298
Activity points
3,647
while /do-while loop

body of while loop never execute if test condition is false.... where as body of do while loop executes atleast one time even test condition is false b/c in while loop test condition is check first, on the other hand in do while test conditon check always chk after the body of loop execution.
 

jayavardhan

Full Member level 2
Joined
Sep 1, 2006
Messages
126
Helped
3
Reputation
6
Reaction score
0
Trophy points
1,296
Location
India
Activity points
1,851
while /do-while loop

while loop never execute if test condition is fails where as do while loop executes atleast one time.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top