/*
Write a complete program that reads integers m and n and character c from the console and outputs mn occurrences of the c arranged in a rectangle with m rows of n columns.
*/
#include <iostream>
usingnamespace std;
int main ()
{
int m, n;
char c;
cin >> m >> n >> c;
for (int rows = 0; m <= 4; m++)
{
for (int columns = 0; n <= 6; n++)
{
cout << c;
}
}
return 0;
}
You have the right concept, but the for loops are incorrect. The center part of the for loop should be rows < m and columns < n and after the inner for loop std::cout << endl; would be usefull to get to a new line.
Hope that helps,
Andy
P.S. Do not forget to change m++ and n++ to rows++ and columns++.