This site requires JavaScript, please enable it in your browser!
Greenfoot back
Recorsi
Recorsi wrote ...

2018/4/6

How do i add more than 1 to an int value?

Recorsi Recorsi

2018/4/6

#
For example i have:
int X = 10;
If i type X++; it adds one to X How can i add more than one to X?(so that X=12 for example)
danpost danpost

2018/4/6

#
Recorsi wrote...
If i type X++; it adds one to X How can i add more than one to X?(so that X=12 for example)
x = x+2;
// or just
x += 2;
Recorsi Recorsi

2018/4/7

#
Thanks
You need to login to post a reply.