Write a program to read the full-name from the keyboard and display its corresponding short name. 10 Ex : I/P : ANIL KUMAR GULATI 0/P : A K GULATI
Answers
Answered by
13
#include <stdio.h>
int main()
{
char fname[20], mname[20], lname[20]; /* person's name */
printf("Enter full name (first middle last): ");
scanf("%s %s %s", fname, mname, lname);
printf("Abbreviated name: ");
printf("%c. %c. %s\n", fname[0], mname[0], lname);
return 0;
}
Similar questions