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

Explain what are header files and explain what are its uses in c programming?

621


What are the types of operators in c?

606


Hi how many types of software editions are there and their difference (like home editions, enterprise, standard etc) can u please help me

1452


FILE *fp1,*fp2; fp1=fopen("one","w") fp2=fopen("one","w") fputc('A',fp1) fputc('B',fp2) fclose(fp1) fclose(fp2)} a.error b. c. d.

1191


What is the use of pragma in embedded c?

585






What is the value of h?

585


What does == mean in texting?

657


what is uses of .net

1267


Is array name a pointer?

600


write a program to find out prime number using sieve case?

1631


What are the benefits of c language?

639


What is type qualifiers?

653


Wt are the Buses in C Language

2744


How do you initialize pointer variables?

602


What are keywords in c with examples?

600