Programming Exercises
Write a program that creates an array with 26 elements and stores the 26 lowercase letters in it. Also have it show the array contents.
Use nested loops to produce the following pattern:
$ $$ $$$ $$$$ $$$$$
Use nested loops to produce the following pattern:
F FE FED FEDC FEDCB FEDCBA
Have a program request the user enter an uppercase letter. Use nested loops to produce a pyramid pattern like this:
A ABA ABCBA ABCDCDA ABCDEDCBA
The pattern should extend to the character entered. For instance, the preceding pattern would result from an input value of E. Hint: Use an outer loop to handle the rows. Use three inner loops in a row, one to handle the spaces, one for printing letters in ascending order, and one for printing letters ...
Get C Primer Plus®, Third Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.