Diff between for loop and while loop?

Answer Posted / keerthana

for loop is executed the condition is satified ..the loop
is executed. ex: n=5 ..the loop is 5 times executed..becoz
the condition is true..otherwise loop is exit.

while loop is executed the condition is true..otherwise
after one time..executed until the condition is false..

Is This Answer Correct ?    15 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Differentiate between declaring a variable and defining a variable?

607


Is there any possibility to create customized header file with c programming language?

626


What is the function of multilevel pointer in c?

670


What are the features of c language?

621


Program will then find the largest of three numbers using nested if-else statements. User is prompted to enter three numbers. Program will find the largest number and display it on the screen. All three numbers entered by the user are also displayed. If user enters 21, 33, and 5, the output should be as follows: You entered: 21, 33 and 5. The largest number is 33.

1014






Why doesnt this code work?

618


What will be the outcome of the following conditional statement if the value of variable s is 10?

767


What are preprocessor directives in c?

638


A variable that is defined in a specified portion of a program but can be used throughout the program a) global variable b) local variable c) character d) none

733


How do I round numbers?

601


Explain the meaning of keyword 'extern' in a function declaration.

726


What is indirection?

653


What is the total generic pointer type?

728


What are the types of type specifiers?

623


How can I find out the size of a file, prior to reading it in?

622