write a C program to print first letter of your surname on the screen. for example if the first letter of your surname is p then the output should be.
Answers
Answered by
4
#include<stdio.h>
int main()
{
char str[200];
int i=0;
int j=0;
int len;
printf("Enter a string: ");
gets(str);
printf("%c",*str);
len = strlen(str);
for(i=0;i<=13;i++)
{
if(str[i]==' ')
{
for(j=i;j<len;j++)
{
putchar(str[j]);
}
}
i++;
}
return 0;
}
This is the code for Print the initials of a name keeping the surname.
int main()
{
char str[200];
int i=0;
int j=0;
int len;
printf("Enter a string: ");
gets(str);
printf("%c",*str);
len = strlen(str);
for(i=0;i<=13;i++)
{
if(str[i]==' ')
{
for(j=i;j<len;j++)
{
putchar(str[j]);
}
}
i++;
}
return 0;
}
This is the code for Print the initials of a name keeping the surname.
ashish9762:
Hii
Answered by
0
Answer:
#include<stdio.h>
int main()
{
char str[200];
int i=0;
int j=0;
int len;
printf("Enter a string: ");
gets(str);
printf("%c","str);
len = strlen(str);
for(i=0;i<=13;i++)
{
if(str[i]=='')
{
for(j=i;j<len;j++)
{
putchar(str[j]);
}
I++;
}
return 0;
Similar questions