64 778
Assignments Done
99,3%
Successfully Done
In September 2018

Answer to Question #27918 in C++ for red rose

Question #27918
Modify the function created in question 6 above to form the square out of whatever character is contained in character parameter fillCharacter. Thus, if side is 5 and fillCharacter is #, then this function should print the following:


#####

#####

#####

#####

#####
Expert's answer
#include <iostream>

using namespace std;

void print_square(int size, char fillCharacter)
{
for (int x = 0; x < size; x++)
{
for (int y = 0; y < size; y++)
cout << fillCharacter;
cout << endl;
}
}

int main()
{
print_square(5, '#');
return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions