Question: Write a function to output the figure below. Note that the number of the rows is not fixed, it depends on your input, and the

Write a function to output the figure below. Note that the number of the rows is not fixed, it depends on your input, and the number of rows has to be an odd number.The function takes 2 parameters. One parameter specifies the size of the diamond to be printed and the other one specifies the number of diamonds.In your main function, the program obtains these two numbers from the user. You should check whether either of them is illegal(0 or negative integer). If either is illegal, it will repeatedly ask the user to enter a new value. For example, if you input 5, 3, the output should look like this: * *** ***** *** * * *** ***** *** * * *** ***** *** * You must use the following template; void print(int size, int num){ //write your code here } int main(){ //write your code here. } 

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!