Build your professional network on facebook via our app Go to app
 
 
 
Asked by : Shashank Shukla, B.Tech/B.E. student, Babu Banarasi Das National Institute of Technology & Management,Lucknow - 227105
Industry : Oil & Gas
Activity: Question posted: 09 14 2011 15:49:05 +0000, 1 answers, 131 views, last activity 09 14 2011 19:22:19 +0000
 
Share
 
 
  Rate : 
 
 
  Answer modified by     Nivesh Agarwal, Electrical Engineer-Industrial, HCST  | 09 14 2011 19:25:16 +0000
[ Delete ]
[ Edit ]
Not Rated

there is a lot of difference between a for, while and do while loop; For loop seldom checks any condition, and basically there is a counter variable that is iterated, so that a code runs a particular number of times.

while loop always checks a condition, and runs until the condition is true, the loop stops as soon as the condition is false. so here in while loop there can be no fixed number of times that the loop will run, it will run until the condition is true !!! ,upto any number of times(not fixed) although condition can be so set that the loop runs desired number of times!!

in a do while loop the loop runs atleast one time although if a condition is contradictory also!!!

It depend upon the situation, that what loop do u use so that ur code is  flexible!!

Hope u get my point !!!

best wishes , NjOy!!

 
Leading recruitment Firm
Unanswered Questions (30)
I guess here I will find my answer. I have a website of web design and development. Its traffic...
 
0 referals 0 answers, 0 views
To put simply, for a advertisement to be unique it must have uniqueness and that uniqueness can...
 
87 referals 0 answers, 0 views