while loop:-
the loop is as follows:-
Syntax:-
while(condition is true)
{
//perform a lot of statements.
// have iteration.
}
for example:-
int i=0;
while(i<=10)
{
printf("%d",i);
i++;
}
the above example will print numbers from 0 to 10
the loop is as follows:-
Syntax:-
while(condition is true)
{
//perform a lot of statements.
// have iteration.
}
for example:-
int i=0;
while(i<=10)
{
printf("%d",i);
i++;
}
the above example will print numbers from 0 to 10
No comments:
Post a Comment