Answer Posted / naresh lingampally
In both the loops the Out put is same.... but the compile
structure is different:
i.e..,
syn: for(i=0;i<=10;i++)
{
statement;
}
while(i<=10)
{
statement;
i++;
} .
i=0; --> initialization.---{1)
i<=10;---> conditioning ---(2)
i++; ---> incrementation ---(3)
in (while) the compiler order would be
(1) .. not along with the loop
(2),(3) in the loop
but in (for) the order is (1),(2),(3) in a single statement.
NOTE: MAJOR DIFFERENCE IS WE CAN REDUCE THE LENGTH OF THE
PROGRAM (FOR) NAD IS MORE SOPHISTICATED.
| Is This Answer Correct ? | 4 Yes | 2 No |
Post New Answer View All Answers
What are the parts of c program?
What is function and its example?
write a programming in c to find the sum of all elements in an array through function.
What are the types of data structures in c?
What does 4d mean in c?
write a proram to reverse the string using switch case?
What is a void pointer? When is a void pointer used?
Does c have an equivalent to pascals with statement?
Simplify the program segment if X = B then C ← true else C ← false
What is the purpose of type declarations?
Which operators cannot be overloaded a) Sizeof b) .* c) :: d) all of the above
What is the difference between variable declaration and variable definition in c?
What will the code below print when it is executed? int x = 3, y = 4; if (x = 4) y = 5; else y = 2; printf ("x=%d, y=%d ",x,y);
Is c# a good language?
What are the 5 data types?