Tuesday, September 8, 2009

PRINT GIVEN STRING FROM FIRST OCCURRENCE OF GIVEN CHARACTER USING C PROGRAM

#include#includevoid main(){ char *p; char s[20],s1[1]; clrscr(); printf("\nEnter a string: "); scanf("%[^\n]",s); fflush(stdin); printf("\nEnter character: "); gets(s1); p=strpbrk(s,s1); printf("\nThe string from the given character is: %s",p); getch();}

No comments:

Post a Comment