simple question and make program that does a t considering the number

int j = 8;

j %= 3;
what's the value of j after that ?

also need help making a program that will do this :
= = = = =
=
=
=
=
in this case the user inserted the number 5, which will be the lenght to the sides and down of ='s. I have no idea where to start to make a program like this.
using <iostream>
Last edited on
...really not sure what you are asking here.

I will start with your 2nd issue.

List of Tutorials for cplusplus.com
http://cplusplus.com/doc/tutorial/

Your question specifically
http://cplusplus.com/doc/tutorial/arrays/

Now as far as your first issue...you are basically now asking for a remainder of a division problem..."Modulo Assignment". If you want to find the answer there is a simple code to find out...

1
2
3
    int j = 8;
    j %= 3;
    cout << j << endl;

If variable j is defined as you showed

int j = 8;

then in this case

j %= 3;

and

j /=3;

will give the same result equal to 2.:)
Topic archived. No new replies allowed.