Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a C program to implement the following requirement: Input: The program will read from the standard input any text up to 1 0 ,
Write a C program to implement the following requirement:
Input: The program will read from the standard input any text up to
characters.
Output: The program will sort the words in alphabetical order and
print to the standard output:
On the first line, the sorted words separated by a comma
On the second line, the index of the sorted words separated by a
comma The index start from
If two words are the same, the smaller index will appear first. A word
is a string without whitespaces spacetabnew line character
If the input text is empty or there is no word in the input text, the
program prints nothing to stdout.
SAMPLE INPUT
hello World!
SAMPLE OUTPUT
hello,World!
SAMPLE INPUT
SAMPLE OUTPUT
SAMPLE INPUT
This is the ST line. This is the ND line.
SAMPLE OUTPUT
STNDisisline.,line.,the,the,This,This
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started