Headlines
Loading...
C program to print an acromatic string.

C program to print an acromatic string.

Write a c program to print an acromatic string.

Eg. Enter ay string : government of india

Acromatic string : goi*/

 

# include<stdio.h>

                        # include<conio.h>

                        # include<string.h>

 

                        void main()

                        {

                          char ch[30];

                          int i=0;

                          clrscr();

                          printf("Enter the string\n");

                          gets(ch);

                          printf("\n%c",ch[0]);

                          while(ch[i]!='\0')

                          {

                          if(ch[i]==' ')

                          {

                            printf("%c",ch[i+1]);

                          }       

                          i++;

                          }

                          getch();

                        }

 

 

/*Output:

 

Enter the string

government of india

 

goi

*/
*** PLEASE checkout the Best deals from for top sites like Amazon, Flipkart etc ***