Lab-8 Ex5 - Reverse Alphabet Pyramid Write a C Program to display the pattern like a pyramid using the alphabet. Get from user the height n (where 1 <= n <= 26) and print a reverse pyramid. You are not required to use functions in this exercise. User-input numbers are bold and italic in the following sample runs. Sample Run #1 4 ABCDCBA .ABCBA. ..ABA.. ...A...
Added by Dennis C.
Close
Step 1
First, we need to get the height of the pyramid from the user. We can use the scanf function to do this. Show more…
Show all steps
Your feedback will help us improve your experience
Ashar Tanveer and 69 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Write a program that will read up to ten letters into an array and write the letters back to the screen in the reverse order. For example, if the input is "abcd", then the output should be "dcba". Use a period as a sentinel value to mark the end of the input. Call the array "letterBox". For this exercise, you need not use any functions. This is just a toy program and can be very minimal.
Tarandeep S.
Write a program where the user inputs a six-letter string. The program displays the six-letter string onto the screen backward. You can use a pointer array of characters and a pointer to a character. You need for-loops and use the getchar() and putchar() functions for reading and writing characters. Output example: Please input a six-letter word abcdef fedcba
Gio M.
(Display a pyramid) Write a program that prompts the user to enter an integer from 1 to 15 and displays a pyramid, as shown in the following sample run:
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
18,000,000+
Students on Numerade
Trusted by students at 8,000+ universities
Watch the video solution with this free unlock.
EMAIL
PASSWORD