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
Why is c called c?
Is javascript written in c?
What is the scope of an external variable in c?
Write the test cases for checking a variable having value in range -10.0 to +10.0?
write a program in C that prompts the user for today's date,tomorrow's date and display the results.Use structures for today's date,tomorrow's date and an array to hold the days for each month of the year.
What are bitwise shift operators in c programming?
Differentiate fundamental data types and derived data types in C.
Tell me the use of bit field in c language?
What is malloc calloc and realloc in c?
What are examples of structures?
write a program to convert a expression in polish notation(postfix) to inline(normal) something like make 723+* (2+3) x 7 (not sure) just check out its mainly printing expression in postfix form to infix.
What's the total generic pointer type?
What is the use of #include in c?
What is the difference between null pointer and wild pointer?
There is a practice in coding to keep some code blocks in comment symbols than delete it when debugging. How this affect when debugging?