Program in C please

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

Program in C please

Post by answerhappygod »

Program in C please
Program In C Please 1
Program In C Please 1 (50.26 KiB) Viewed 22 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 such word, print nothing. Note: If there is nothing from stdin, print nothing. 4 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
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply