Question: In C++, a) Write a recursive function, printZPattern, which prints out a pattern of zeros as follows: printZPattern(3) outputs: 000 00 0 printZPattern(1) outputs: 0

In C++,

a) Write a recursive function, printZPattern, which prints out a pattern of zeros as follows:

printZPattern(3) outputs:

000

00

0

printZPattern(1) outputs:

0

printZPattern(4) outputs:

0000

000

00

0

b) How would you modify your second function to print a mirror pattern, such as: printZPattern2(3) outputs:

000

0

00

000

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!