Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started