Header Ads Widget

Responsive Advertisement

Ticker

6/recent/ticker-posts

WAP which prints initial of any name ?

 WAP which prints the initial of any name?  
 #include<stdio.h>  
 #include<conio.h>  
 int main()  
 {  
   char string[200];  
   int i=0;  
   printf("Enter a string: ");  
   gets(string);  
   printf("%c", *string);  
   while(string[i] != '\0')  
   {  
     if(string[i] == ' ')  
     {  
       i++;  
       printf("%c", *(string + i));  
     }  
     i++;  
   }  
   return 0;  
 }  
 OUTPUT:-  
           Enter a string:  
           C Programming Simply 

 

Post a Comment

0 Comments