Repetition or in other terms is called a loop. Repeating a process is an action that many found in programming. In all programming languages, it repeats the work process with a mechanism called a loop. Using loops, a repeating process that displays the same posts can be implemented with short program code.
Statement of Control Looping on The C/C++ Programming
FOR
WHILE
DO-WHILE
Requirements
Dev C++ 5
Number 1
for (initialization; condition; changes)
{
The statement;
}
int main ()
{
printf("\n \n utopian-io");
int i;
for(i=1;i<=10;i++)
{
printf ("\n \n the usage FOR practical work By Steemcom");
printf (" %d\t \n\n", i);
}
return 0;
}
work result
Initialization;
While (condition)
{
statement;
Change;
}
Number 2
int main()
{
printf("\n \n utopian-io");
int i;
i=1;
while(i<=10)
{
printf("\n \n Practical Usage WHILE By Steemcom ");
printf("%d\t",i);
i=i+1;
}
return 0;
}
work result
Initialization;
do {
statement;
change;
} while (condition);
Number 3
int main ()
{
printf("\n \n utopian-io");
int i;
i=1;
do
{
printf("\n \n Practical use of DO-WHILE By Steemcom ");
printf("%\t",i);
i=i+1;
}while(i<=10);
return 0;
}
work result
Finish
Happy Trying Good Luck
Posted on Utopian.io - Rewarding Open Source Contributors
Your contribution cannot be approved because it does not follow the Utopian Rules.
You can contact us on Discord.
[utopian-moderator]