Repetition In C / C ++ (Looping) on Programing

in #utopian-io7 years ago (edited)

When it comes to repetition, what's in our minds
a repeat occurrence
but this time we discussed Repetition In C ++
From the title of the above, there will be many questions.
and here I will discuss what is the meaning of looping in C ++, what is the general form, and a simple program example that uses looping!
The answer to the first question
Repetition: The loop is a set of activities that repeats a statement to the desired extent.
The answer to the second question
General form Repetition in C ++ language there are 2 among others:

  1. FOREIGN TROUBLE
    Used to repeat a process that has known the number of iterations.
    General Forms:

  2. FOREIGN TROUBLE
    Used to repeat a process that has known the number of iterations.
    General Forms:

for (initialization; condition; changes)
{
Statementl;
Statement2;

  1. WHILE looping
    Used when the number of iterations is unknown.
    General Forms:

while (expression)
{
Statementl;
Statement2;
}

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;

Screenshot (34).png

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;
}

Screenshot (32).png

Finish

Thank You for Reading My Artistry Hopefully Helpful

Follow Me: @steemcom

Thans



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Your contribution cannot be approved because it does not follow the Utopian Rules.

Explaining some concept is not considered a contribution to open source in Development category.

You can contact us on Discord.
[utopian-moderator]