Difference between for loop and while loop?

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

Difference between Shallow copy and Deep copy?

1777


How is = symbol different from == symbol in c programming?

804


If you know then define #pragma?

863


Write an algorithm for implementing insertion and deletion operations in a singly linked list using arrays ?

3258


Are pointers integers in c?

805


How can I manipulate individual bits?

793


Find MAXIMUM of three distinct integers using a single C statement

821


What’s a signal? Explain what do I use signals for?

842


What is the difference between malloc() and calloc() function in c language?

817


What are header files in c?

807


Why c is called a mid level programming language?

822


What is the main difference between calloc () and malloc ()?

832


What is volatile, register definition in C

891


What is main function in c?

774


what is a constant pointer in C

879