+ 1
How to use for loop
6 Answers
0
here instead of i you can use any variable , and instead of N you can put any limit up to which the loop will continue and instead of i++ we can use i-- . all depends on your requirements
0
int i;
for(i=0;i<n;i++)
{ //execute ur code//}
0
for(int i=0; i<=n;i++)
{ /*
your code*/
}
0
Instead of i++ you can also use other statements like i*2 or i+I if you want
0
you can also use foreach
- 3
for( i = 0, i < N, i++)