P3 – Inverted Pyramid of Odd Numbers 1. Write a program that prompts the user to enter an integer from 1 to 15 (that shows the number of lines) and displays an inverted pyramid of odd numbers starting with 1, as shown in the following sample run: Please enter the number of lines: 7 13 11 9. 3 1 11 13 11 9. 3. 1 7 11 9. 3 1 7 6. 5n 3. 1 5n 3. 1 3. 1 1 7777

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter7: Characters, Strings, And The Stringbuilder
Section: Chapter Questions
Problem 7PE
icon
Related questions
Question

USE C++ LANGUAGE 

P3 – Inverted Pyramid of Odd Numbers
Write a program that prompts the user to enter an integer from 1 to 15 (that shows the number of lines)
and displays an inverted pyramid of odd numbers starting with 1, as shown in the following sample run:
Please enter the number of lines: 7
13
11
6.
5n
3.
1
3
9.
11
13
11
9.
1
11
6.
1
3
7.
9.
3.
1
3
5.
1
3
1
3
1
Run the code and show the result for input 9 (9 number of lines).
Your C++ code for this HW
Copy and paste your code here
Sample Run Result
Copy and paste the result here (e.g. the screen shot of the result you get by running the code).
7777
Transcribed Image Text:P3 – Inverted Pyramid of Odd Numbers Write a program that prompts the user to enter an integer from 1 to 15 (that shows the number of lines) and displays an inverted pyramid of odd numbers starting with 1, as shown in the following sample run: Please enter the number of lines: 7 13 11 6. 5n 3. 1 3 9. 11 13 11 9. 1 11 6. 1 3 7. 9. 3. 1 3 5. 1 3 1 3 1 Run the code and show the result for input 9 (9 number of lines). Your C++ code for this HW Copy and paste your code here Sample Run Result Copy and paste the result here (e.g. the screen shot of the result you get by running the code). 7777
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Program on Numbers
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,