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

Explain what is wrong with this program statement?

0 Answers  


To what value do nonglobal variables default? 1) auto 2) register 3) static

4 Answers  


What's wrong with the call "fopen ("c:\newdir\file.dat", "r")"?

1 Answers  


how to find sum of 5 digits in C?

4 Answers  


What is the use of clrscr?

0 Answers  






how can be easily placed in TCS.

0 Answers   TCS,


What is FIFO?

0 Answers  


How can you return multiple values from a function?

0 Answers  


hOW Can I add character in to pointer array of characters char *a="indian"; ie I want to add google after indian in the char *a

1 Answers  


What are the uses of pre-processor directives?

2 Answers  


#include <stdio.h> int main ( int argc, char* argv [ ] ) { int value1 = 10; int value2 = 5; printf ( "\n The sum is :%d", value1 | value2 ); } This is the answer asked by some one to add two numbers with out using arithmetic operator?Yes this answer is write it given out put as 15.But how????? what is need of following line? int main ( int argc, char* argv [ ] ) how it work?what is the meaning for this line? please explain me.Advance thanks

9 Answers   Excel,


Every time i run a c-code in editor, getting some runtime error and editor is disposing, even after reinstalling the software what may be the problem?

2 Answers  


Categories