ANSWER in PUNJAbi
22ji e ta bahut sokha hai..
looping statement di help naal asi program de kise v hisse nu vaar vaar chla sakde ha. man lo tussi apna naam 200 vaar print krana hai , ta "printf" command 200 var likhni peni hai, but looping di help naal asi e kam sirf ik vaar "Printf" likh k kar sakde haa. for(i=0; i<200; i++) { printf("gurpreet singh 3184/w"); }
int i=0;
while(i<200)
{
printf("gurpreetsingh3184/w");
i++;
}
In the C language, the continue statement can only be used within a loop (for, while, or do). Upon execution, control transfers to the beginning of the loop.
A loop in computer languages is a set of statements that execute repeatedly, based on some criteria.In C and C++, the three looping statements are while, do, and for...while (test-expression) statement;/* statement executes zero or more times, until test-expression is false, test first */do statement while (test-expression);/* statement executes one or more times, until test-expression is false, test last */for (init-expression, test-expression, loop-expression) statement;/* init-expression executed once, at beginning *//* statement executes zero or more times, until test-expression is false, test first *//* loop-expression evaluated at end of each iteration */Often, statement, is a set of statements, such as...while (test-expression) {... statements}
The compiler demands it: your programs wouldn't compile without them.
anything ending in semicolon/;
semicolon ';' (Not applicable for block-statements)
differance between control statement and looping statement?
for,while,do while
while, for, do-while (and perhaps goto)
In the C language, the continue statement can only be used within a loop (for, while, or do). Upon execution, control transfers to the beginning of the loop.
Usually the loop is used for repeating the same task for more than one time. If you don't give the terminating statement then the loop will go in infinite condition.
There are several 'looping' statements in C++. They are:while () { }do { } while () ;for (index-start, index-end; index increment/decrement) { }They are used to repetitively execute statements as long as the statement(s) controlling the loop are true.
Any experssion including assignment or a function call can be a statement in C
A loop in computer languages is a set of statements that execute repeatedly, based on some criteria.In C and C++, the three looping statements are while, do, and for...while (test-expression) statement;/* statement executes zero or more times, until test-expression is false, test first */do statement while (test-expression);/* statement executes one or more times, until test-expression is false, test last */for (init-expression, test-expression, loop-expression) statement;/* init-expression executed once, at beginning *//* statement executes zero or more times, until test-expression is false, test first *//* loop-expression evaluated at end of each iteration */Often, statement, is a set of statements, such as...while (test-expression) {... statements}
anything ending in semicolon/;
One of the statements, obviously.
The compiler demands it: your programs wouldn't compile without them.
Statements. Typical usage: if (<condition>) <statement>; else <statement>;