Let us use character arrays fname, mname and lname to store the first name, middle name and last name of a person. The program given below first accepts the full name, i. e., values of fname, mname and lname using a scanf function. Then the name is printed in the desired abbreviated form using a printf function. The initial letters of fname and mname are printed using fname and mname, respectively. The program is given below.