For (Counting)

ok i think i know about counting forward, as i know it should go like
1
2
3
4
5
6
int a = 10;
int b = 0;
for (i=0,a<10,i++){
      b++;
 }
cout<<b;

but now how to do it reverse i just cant figure it out

for example to put a number for example int c = 30.... so it will count from c to a(which is 10) so that b would be 20
The commas should be semicolons. Anyways, it doesn't work any differently. Just that instead of
i=0;a<10;++i
you would put
i=c;c>=a;--i
Last edited on
something like...

 
for (i=a,i<c,i++){
Topic archived. No new replies allowed.