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

How can I remove the trailing spaces from a string?

0 Answers   Aspire,


can anyone proide me reading material on svit00ef27@yahoo.com please thanx in advance

1 Answers   IBM,


What is a far pointer in c?

0 Answers  


What is the difference between class and object in c?

0 Answers  


How can I do peek and poke in c?

0 Answers  






exit () is used to a) exit () terminates the execution of the program itself b) exit () terminates the execution of the loop c) exit () terminates the execution of the block d) none of the above

0 Answers  


What is the memory allocated by the following definition ? int (*x)();

2 Answers   ADITI,


What is the relationship between pointers and data structure?

0 Answers  


What is C language ?

0 Answers   Jekson,


What is a shell structure examples?

0 Answers  


What are unions in c?

0 Answers  


#include<stdio.h> main() { int i=5; printf("%d",i*i-- - --i*i*i++ + ++i); } tell the answer with correct reason .specially reason is important nt answer ans by turbo c is -39

1 Answers   GameLoft,


Categories