Question: Write a C program that meets the following requirements: Input: The program will read from the standard input any text up to 1 0 ,
Write a C program that meets the following requirements:
Input: The program will read from the standard input any text up to characters.
Output: The program will filter out only the words containing the term CS and then sort them in ASCII order. The output should be printed in the following format:
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 starts from
Note:
A word is a string without whitespaces spacetabnew line character The length of each word is not greater than
If two words are the same, the smaller index will appear first.
If the input text is empty or does not contain the word CS the program prints nothing to stdou
You can only use putchar getchar printf scanf for standard inputoutput functions.
You may only include the stdio.h and stdlib.h libraries.
SAMPLE INPUT
CSClass, CSAssignment and myCSexperiment
SAMPLE OUTPUT
CSAssignment,CSClass,,myCSexperiment
SAMPLE INPUT
This is the first line.
SAMPLE OUTPUT
I am a beginner could you write it beginner way with some explanation thank you!
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
