Well according to your function definition draw_line, you can simply call that function once an the output will be a box.
You should learn how to use nested for loop for this task, I assume you tried to use nested for loops but incorrectly.
Try this:
cpp
#include <iostream>
using namespace std;
//Function prototype
void draw_box(char what, int length, int height);
int main() {
char what;
int height, length;
cout << " Mateen Rehman " << endl;
cout << " please enter a letter" << endl;
cin >> what;
cout << " please enter a number for length" << endl;
cin >> length;
cout << " please enter a number for height" << endl;
cin >> height;
draw_box(what, length, height);
return 0;
}
void draw_box(char what, int length, int height) {
//using nested for-loops for output
for (int i = 0; i < height; i++) {
for (int j = 0; j < length; j++)
cout << what;
cout<<endl;//new line when the characters are printed horizontally once
}
}
I have changed the draw_line function name to draw_box.
More help? Keep posting !