Difference between for loop and while loop?



Difference between for loop and while loop?..

Answer / dev yadav

in for loop we should know initial &last condition.....but in while loop we only know the last condition....
ex. of for loop..for(i=0;i<=10;i++){
printf("%d",i);
}
ex. of while loop..while(i<=10){
printf("%d",i);
i++;
}

Is This Answer Correct ?    10 Yes 4 No

Post New Answer

More C Interview Questions

Is register a keyword in c?

0 Answers  


WHAT IS RTGS N MINIMUM AMT TO B TRANSFERD N WHAT R THE CHARGES ON MINIMUM AMT N IN WHICH BANK WE CAN DO IT?

1 Answers  


Is flag a keyword in c?

0 Answers  


char *p="name"; printf(p);

1 Answers  


any limit on the number of functions that might be present in a C program a) max 35 functions b) max 50 functions c) no limit d) none of the above

0 Answers  






What is the difference between typeof(foo) and myFoo.GetType()?

2 Answers   Synergy,


What are the applications of c language?

0 Answers  


What is the size of a union variable?

0 Answers  


Is int a keyword in c?

0 Answers  


WAP to convert text into its ASCII Code and also write a function to decode the text given?

2 Answers  


What is the use of clrscr?

0 Answers  


What is 1f in c?

0 Answers  


Categories