There are two different program that use loop, I want to make program that show both of two program result line up horizontally, what im confuse is both of them use for loop function so when debug it, the first program will show all the result vertically then continue to second program. I tried to use nested loop to print row as outside loop but the number of iteration of two program is different so i cant unify it.
output = https://ibb.co/gw1tAk
for ( init; condition; increment ) {
statement(s);
}
Or maybe use array(?)
first program :
int main()
{
float x;
int i;
for(i=0;i<=100;i++) {
x=i/100.0;
printf("x=%f\n",x);
}
return 0;
}
second program:
int main()
{
float x;
for(x=0.0;x<=1.0;x+=0.01)
{
printf("x=%f\n",x);
}
return 0;
}
cant unify the loop(?) since the first one will iterate 109 times(?) and the second program 101 times
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
Both has same amount of iterations.