Question: Write a program to display the following pattern on the screen. Your program must prompt the user for the number of lines to be printed

Write a program to display the following pattern on the screen. YourWrite a program to display the following pattern on the screen. Your program must prompt the user for the number of lines to be printed and the desired width between the left and right figures. Note that the number of lines must be an even number. If the number of lines entered is an odd number, then your program must display a message 'Invalid input - number of lines must be even' and exit.

Sample Input: umber of lines? 10 Width between left and right figure? 3 Output: x * * t

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!