Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a program that asks for a number, and then prints twice as many lines as t

ID: 3914968 • Letter: W

Question

Write a program that asks for a number, and then prints twice as many lines as the user inputs. The first half of every other line contains one"" character at the start, as many spaces as the number of this line(line numbers count from 0 in this task) and one"character at the end of the line. The second half is a mirror reflection of the first. It print the same result as the expected output. To do this task. you should use two outer for use any special formatting in printf to print the spaces - just use the for bop Two exceptions: should look ike an arrowhead. Your version of the program must bops and two iner for bop. You shoukdr' When the user inputs a number less than 1, then the program doesn't write any line. . When the user inputs a number greater than 20, then the program writes only forty lines.

Explanation / Answer

#include using namespace std; int main() { int n; cin >> n; if(n >= 1) { if(n > 20) { n = 20; } for(int i = 0; i
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote