You are given a string S. You need to print short name of the given string.
Input Format
The first and only line of input contains a string S.
Constraints
1 <= |S| <= 100
Output Format
You need to print the short name of provided string.Sample Input 0
Mohd Kafeel Khan
Sample Output 0
M. K. Khan
Answers
Answered by
4
Answer:
vhsjsgsiw vh sbsssusksvssnisss by. basha ok svs
Answered by
0
Answer:
M. K. Khan
Explanation:
#include<stdio.h>
int main()
{
char name[30]="Mohd_Kafeel_Khan";
int i=0,j=1;
while(name[i]!='\0')
{
if( name[i]==32 && j<1)
{
printf("%c.",name[i+1]);
i++;
}
else if(i==0)
printf("%c.",name[0]);
else if(name[i]==32)
{
while(name[i]!='\0')
{
printf("%c.",name[i+1]);
j++;
}
}
i++;
}
}
Similar questions