Translate

Labels

Saturday, 8 June 2013

ACHROMATIC STRING

#include<stdio.h>
#include<conio.h>
main()
{
char ch[100];
int i;
clrscr();
printf("Enter any string:");
/*to accept multi word string gets() is used*/



gets(ch);
i=0;
printf("\n%c",ch[0]);
while(ch[i]!='\0')
{
if(ch[i]==' ')
{
i++;
printf("%c",ch[i]);
}
i++;
}
getch();
}

OUTPUT:
Enter any string: Achromatic String
AS

No comments: