Question:C code which prints initial of any name 

Answer 
#include<stdio.h>
int main(){
   char str[20];
   int i=0;
   printf("Enter a string: ");
   gets(str);
   printf("%c",*str);
   while(str[i]!='\0'){
       if(str[i]==' '){
            i++;
            printf("%c",*(str+i));
       }
       i++;
   }
   return 0;
}
Sample output: Enter a string: Robert De Niro RDN 

+ Report
Total Preview: 836
C code which prints initial of any name
Copyright © 2024. Powered by Intellect Software Ltd