Question: Write a C (NOT C++) program that will read in one character per line until you hit a 0 (zero as a character), store those

Write a C (NOT C++) program that will read in one character per line until you hit a 0 (zero as a character), store those characters in an array, sort that array (from largest to smallest) and print out each character with a space between them (no newlines).

Notes:The file that will have the characters in it is alphabet.txt. Remember how to do file redirection: myprog < alphabet.txt The file will have one character per line so you will need to also read in the newline after you read in each character. You must: Use an array to store the characters Read the characters in from stdin Make your output print as: z y x a There will only be 1 newline and that is after the last character printed.

alphabet.txt

f k s j p a v r t u h m g e b y n z w l i x q c d 0

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!