Page 1 of 1

Input: The program will read from standard input 2 lines of text (each line is separated by a newline character ‘\n’ ) a

Posted: Fri May 20, 2022 4:40 pm
by answerhappygod
Input: The program will read from standard
input 2 lines of text (each line is separated by a newline
character ‘\n’ ) and then: - Store each word on the first line into
a node of a linked list L1. No duplication allowed. - Store each
word on the second line into a node of a linked list L2. No
duplication allowed. The implementation of a node of a linked list
is the following: struct NODE { char *word; Struct NODE *next;
};
Output: The program will print to standard
output the list of common words of both L1 and L2 in alphabetical
order. Each word is separated by a single comma “,”. If there is no
such word, print nothing.
Input The Program Will Read From Standard Input 2 Lines Of Text Each Line Is Separated By A Newline Character N A 1
Input The Program Will Read From Standard Input 2 Lines Of Text Each Line Is Separated By A Newline Character N A 1 (431.18 KiB) Viewed 27 times
Write a C program to implement the following requirement: Input: The program will read from standard input 2 lines of text (each line is separated by a newline character '\n') and then: - Store each word on the first line into a node of a linked list L1. No duplication allowed. - Store each word on the second line into a node of a linked list L2. No duplication allowed. The implementation of a node of a linked list is the following: struct NODE { char *word; Struct NODE *next; }; Note: - A word is a string that does not contain any whitespace with a maximum of 100 characters. - The word(s) should be converted into LOWERCASE before adding to the linked list. – The input does not end with a new line character '\n'. Output: The program will print to standard output the list of common words of both L1 and L2 in alphabetical order. Each word is separated by a single comma ",". If there is no Ich word, print nothing. Note: If there is nothing from stdin, print nothing.

SAMPLE INPUT 1 This is the first line. This test has 4 words that appear in both list. This is the second LINE. SAMPLE OUTPUT 1 is,line. , the, this SAMPLE INPUT 2 Hello CS240, This is the FINAL EXAM. SAMPLE OUTPUT 2 <empty>