WAP to print the string from given character ?
#include<string.h>
#include<stdio.h>
int main()
{
char *ptr;
char str[20],str1[1];
printf("\nplease enter a string: ");
scanf("%[^\n]",str);
fflush(stdin);
printf("\nplease enter character: ");
gets(str1);
ptr=strpbrk(str,str1);
printf("\nThe string from the given character is: %s",ptr);
return 0;
}
No comments:
Post a Comment