for loop problem
Hello wondering how I can get my program to run
i=1 j=2
i=1 j=3
i=1 j=4
i=2 j=3
i=2 j=4
i=3 j=4
Used
1 2 3 4 5 6 7 8 9 10 11 12 13 14
|
#include <iostream>
using namespace std;
int main()
{
int i,j;
for(i = 1; i<=3; i++)
{
cout << "\ni is now " << i << endl;
for(j = 2; j<=4; j++)
cout << "j = " << j;
}
return 0;
}
|
I know I am missing that j>i or i<j I just don't know what to do or where to insert it or if I need another loop? Please help,
thanks!
change j = 2 to j = i + 1.
Thank you so much!
Topic archived. No new replies allowed.