I wanted to use nested for loop to compile the results above.
but the sequence I do not know how to do it. Since it increase each row and column differently.
int main()
{
constint NUM_COLS = 10;
int col = 1;
for (int num = 5; num <= 200; num += 5)
{
std::cout << num << "\t";
if (col++ % NUM_COLS == 0)
std::cout << "\n";
}
return EXIT_SUCCESS;
}
% is the modulo operator. It gives the remainder of an integer division. In your case I use it to print a newline after 10, 20, 30, 40 numbers.
Change NUM_COLS to a different value to see how it works.