Computer Science, asked by dhruvi574, 1 year ago

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 ashish9762
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.

ashish9762: Hii
ashish9762: Dhruvi
Answered by chudasamamihir701
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