Repetitive statements in C
In some C program, we have to repeat certain step during program execution. This can be done with the help of the repetitive statements or loop statements. They are While, do ......... while, for.
The syntax of this statement as follows :-
1)
while (expression)
{
statements;
}
2)
do
{
statements:
}
while(expression);
3)
for(exp1; exp2; exp3)
{
statements;
}
The syntax of this statement as follows :-
1)
while (expression)
{
statements;
}
2)
do
{
statements:
}
while(expression);
3)
for(exp1; exp2; exp3)
{
statements;
}
0 comments:
Post a Comment