program to locate string with in a string with using strstr
function
Answer Posted / pradeep
#include<stdio.h>
#include<string.h>
void main()
{
char *str1,*str2,*ptr;
printf("Enter string1:");
scanf("%s",&str1);
printf("Enter string2:");
scanf("%s",&str2);
ptr=strstr(str1,str2);
if(ptr==0)
printf("String not located");
else
printf("string located are %s",ptr);
}
| Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
Wt are the Buses in C Language
How can I find out how much free space is available on disk?
How do you declare a variable that will hold string values?
what are non standard function in c
How many header files are in c?
Can static variables be declared in a header file?
What are header files why are they important?
Tell me what are bitwise shift operators?
What are the types of i/o functions?
can we have joblib in a proc ?
5 Write an Algorithm to find the maximum and minimum items in a set of ānā element.
What are valid signatures for the Main function?
What is else if ladder?
Explain what is the benefit of using #define to declare a constant?
How can variables be characterized?