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 10,000 characters.
Output: The program will filter out only the words containing the term "CS240" 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 0.
Note:
A word is a string without whitespaces (space/tab/new line character). The length of each word is not greater than 1000.
If two words are the same, the smaller index will appear first.
If the input text is empty or does not contain the word "CS240", the program prints nothing to stdou
You can only use putchar(), getchar(), printf(), scanf() for standard input/output functions.
You may only include the stdio.h and stdlib.h libraries.
SAMPLE INPUT 1
CS240Class, CS240Assignment and my_CS240_experiment
SAMPLE OUTPUT 1
CS240Assignment,CS240Class,,my_CS240_experiment
1,0,3
SAMPLE INPUT 2
This is the first line.
SAMPLE OUTPUT 2
3,4,5,9
I am a beginner could you write it beginner way with some explanation thank you!
Write a C program that meets the following

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 Programming Questions!