so I'm confused about how to solve this problem in C. The answer to this question is more likely solve if I can understand the logic. But it seems I cant understand it. Sorry if the question title does not matches the explanation of the problem. So:
In C, loop with using for like this, for(x=0;x<10;x++)
, this will result to loop simultaneously without a break.
For example:
for(x=0;x<10;x++)
printf("this is x = %d",x);
result example:
this is x = 0
this is x = 1
.
.
this is x = 10
So how to loop, but will break in each new number and start over then break/pause until new numbers and so on. For example:
for(x=0;x<//variables;x++)
printf("this is x = %d",x);
result:
(start)
this is x = 0
this is x = 1
(over/break)
(start)
this is x = 0
this is x = 1
this is x = 2
(over/break)
(start)
this is x = 0
this is x = 1
this is x = 2
this is x = 3
(over/break)
.
.
.
(start)
this is x = 0
this is x = 1
this is x = 2
this is x = 3
.
.
.
this is x = 10
(over/break)
So how to do this? This maybe seems simple but I can't find the solution. I hope the explanation can make the problem clear. Thank you.