Diff between for loop and while loop?

Answer Posted / keerthana

for loop is executed the condition is satified ..the loop
is executed. ex: n=5 ..the loop is 5 times executed..becoz
the condition is true..otherwise loop is exit.

while loop is executed the condition is true..otherwise
after one time..executed until the condition is false..

Is This Answer Correct ?    15 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the time and space complexities of merge sort and when is it preferred over quick sort?

770


What is Dynamic memory allocation in C? Name the dynamic allocation functions.

700


How to write a program for machine which is connected with server for that server automatically wants to catch the time for user of that machine?

1688


Tell me about low level programming languages.

731


What is the difference between functions abs() and fabs()?

754






Can you mix old-style and new-style function syntax?

763


What is a program flowchart?

698


What are keywords c?

696


What was noalias and what ever happened to it?

683


How variables are declared in c?

669


What is the use of c language in real life?

636


What is preprocessor with example?

677


What is the total generic pointer type?

824


main() { inta=10,b=20; a>=5?b=100:b=200; printf("%d ",b); }

1018


Should I learn c before c++?

801