Home Forums C Programming please help me in this… Reply To: please help me in this…

#3453
bajean
Participant

sir thanx for ur post,
yaa…its good…..but sir is it necessary to input three strings…..???
below written  program will output initials of the name… 


#include
#include
#include
void main()
{
int i,l;
char name[40];
clrscr();
printf("enter ur name:");
gets(name);
l=strlen(name);
printf("%c",name[0]);
for(i=0;i<=l;i++)
{
if(name==' ')
{
printf("%c",name[i+1]);
}
}
getch();
}

can u modify this one??….to get the desired output….