Header Ads Widget

Responsive Advertisement

Ticker

6/recent/ticker-posts

WAP to print the string from given character ?

 WAP to print the string from the 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;  
 } 

 

Post a Comment

0 Comments