for (<exp1>; <exp2>; <exp3>) <statement>
exp1 and exp3 are optional; statement can be null-statement or block-statement.
Correction:
All expressions are optional. An infinite loop has no expressions:
for(;;);
for(i=0;i<=0;i++)
loop within in a loop is called for next loop
Yes. while loop consist of only condition statement to make for loop look as while loop we can use syntax shown below: for(;condition;) eg: for(;i<=n;)
In C (and C++ and Java), the semicolon is used to mark the end of a statement. It is also used the separate the expressions in a for loop.
There is no 'foreach' in C
The do while loop is also called an exit condition loop in c, c++, and java.
do { //statements }while(condition); The statements inside the block get executed at-least once, no matter what condition you have placed. Only from the 2nd time the condition is checked, simply because the condition is at the last. for(initialization; condition; updation) { //statements } Here the statements don't get executed even once if the condition fails initially. The condition is at the entry itself.
No. A syntax error is a statement that fails to compile. Infinite loops are simply loops for which the number of iterations is unknown. However, all loops, whether counted loops or infinite loops, must have a reachable exit condition. If a loop does not have a reachable exit condition then it is a logic error, not a syntax error.
cmd c:
syntax is the way you write your code in it defines the meaning of keywords & how to write
You can use any number of if staments within a for-loop, eg: for (i=0; i<10; ++i) { if (i=1) printf ("%d=1\n",i); }
The while loop in vb.net uses the syntax form which provides a way to continue iterating while one or more conditions are true.