Array and Strings – Strings – Problem #1
IIT Kharagpur CS10001 / CS11001 Programming and Data Structures Lab Question Archive
Problem Statement
In a department there are several faculty members who are most commonly known as by their short name. For example, "Abhijit Das" is known as AD, "Partha Pratim Das" is known as PPD, "Jayanta Mukhopadhyay" is known as JM, etc. Here, "Abhijit Das", "Partha Pratim Das", and "Jayanta Mukhopadhyay" is full name of which AD, PPD, and JM is the short name respectively. Students use to remember the faculty members by their short names only. Write a C program that will read a short name first and then keep on asking the full name of the faculty members and read the full name as an array of characters (use %c and loop, not %s) until it gets a full name of which short name was entered. Then print the full name and the short name (using %s not %c) of the faculty member and come out of the program. Read, store, and process the current full name. Do not store more than one full name to process later - in other words do not use 2D arrays.