I have a code here that displays integers from 1-100 using 5 columns.
I would like to know how to only display the numbers that are divisible by 6 and 7.
Don't touch the if (rows % 5 == 0) cout << endl; logic, that's fine as is.
Add additional logic to only cout << i if i is divisible by 6 and 7 (i.e. divisible by 42).
display the numbers that are divisible by 6 and 7.
Your text says 6 and 7, but the sample output is (divisible by 6) XOR (divisible by 7). So do you mean AND, OR or XOR? The code below assumes XOR to generate your sample output.
Add additional logic to only cout << i if i is divisible by 6 and 7 (i.e. divisible by 42).
Actually all of the current logic in the loop should only occur when divisible by 6 and/or 7, not just the cout.