Question: Write an empty main function and include the standard input/output library. Write a function called print_mat() that accepts two integers: m an n, and prints

 Write an empty main function and include the standard input/output library.

Write an empty main function and include the standard input/output library. Write a function called print_mat() that accepts two integers: m an n, and prints an m by n square of spaces and 15 as shown below. Notice that it draws an m byn box. There are 1's on the boarder and spaces inside. Hint: Write a nested loop to print m rows and n columns of ones (test it) add code to print the selected pattern (test again). Notice that the top has i (iterator for rows) equals O and left side hasj (iterator for columns) equals O. What are the values for i and j to put 1's on the bottom and the right side? Add a prototype for print_mat(). Add code to your main function to test your code for 8 rows and 10 columns. The output should look like below. Output 1111111111 1 1 1 1 1 1 1 1 1 1 1 1 1111111111 Copy and paste your code below

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!