answersLogoWhite

0

What the syntax of for loop in c?

User Avatar

Anonymous

13y ago
Updated: 8/20/2019

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(;;);

User Avatar

Wiki User

13y ago

What else can I help you with?

Related Questions

Syntax of for loop in c language?

for(i=0;i&lt;=0;i++)


What is the definition and syntax of for next loops?

loop within in a loop is called for next loop


What is the syntax for writing a loop in pseudo code?

The syntax for writing a loop in pseudo code typically involves using keywords like &quot;for&quot;, &quot;while&quot;, or &quot;do-while&quot; to indicate the type of loop, followed by the loop condition and the code block to be executed within the loop.


Why you use colon in C language?

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.


Is it possible to use a for loop in place of a while 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&lt;=n;)


What is the syntax of foreach in c?

There is no 'foreach' in C


Which loop is also called an exit-condition loop in C programming?

The do while loop is also called an exit condition loop in c, c++, and java.


What is the difference between do while and for loop?

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.


Is an infinite loop an example of a syntax error?

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.


The PHP syntax is similar to which languages?

Its similar to a number of languages such as C, C++, Java and Perl.


How do you use if statement syntax in a for loop?

You can use any number of if staments within a for-loop, eg: for (i=0; i&lt;10; ++i) { if (i=1) printf ("%d=1\n",i); }


What are while loop in vb.net?

The while loop in vb.net uses the syntax form which provides a way to continue iterating while one or more conditions are true.