Write a C progran to implement the following requirement: Input: The program will read from the standard input any text

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Write a C progran to implement the following requirement: Input: The program will read from the standard input any text

Post by answerhappygod »

Write A C Progran To Implement The Following Requirement Input The Program Will Read From The Standard Input Any Text 1
Write A C Progran To Implement The Following Requirement Input The Program Will Read From The Standard Input Any Text 1 (36.89 KiB) Viewed 28 times
Write a C progran to implement the following requirement: Input: The program will read from the standard input any text up to 10,000 characters. Output: The progran will sort the words in alphabetical order and print to the standard output: On the first line, the sorted words separated by a conna, On the second line, the index of the sorted words separated by a comma",". The index start from . It two words are the same, the smaller index will appear first. (A word is a string without whitespaces (space/tab/new line character)) Note: It the input, textos empty or there is no word in the input text, the program must print the enpty string to stdout. Requirements: Use the following struct to store the word and its index: struct WORD char *5: int index: } YOU MUST use pointer to do the sorting. It you don't use pointer, you will get 6. SAMPLE INPUT 1 hello world! 123 SAMPLE OUTPUT 1 123, hello, World! 2,8,1 SAMPLE INPUT 2 cempty SAMPLE OUTPUT 2 cempty> SAMPLE INPUT 3 This is the 1ST line. This is the 2ND line. SAMPLE OUTPUT 3 IST, 2ND, 1s, is, line., line.,the, the, This, This 3,8,1,6,4,9,2,7,0,5
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply