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 so popular?
What are loops in c?
What does c mean before a date?
In C language, a variable name cannot contain?
in programming languages a statement or part of a statement that specifies several different execution sequences a) constructs b) distructs c) executes d) none
Create a registration form application by taking the details like username, address, phone number, email with password and confirm password (should be same as password).Ensure that the password is of 8 characters with only numbers and alphabets. Take such details for 3 users and display the details. While taking input password must appear as “****”.
Explain how can I read and write comma-delimited text?
What is the purpose of sprintf() function?
how do you execute a c program in unix.
How can I open a file so that other programs can update it at the same time?
What does main () mean in c?
What is the role of && operator in a program code?
What is the difference between declaring a variable by constant keyword and #define ing that variable?
How do we declare variables in c?
write a c programming using command line argument,demonstrate set operation(eg;union,intersection,difference) example output is c:>setop 12 34 45 1 union 34 42 66 c:>setop 12 34 1 42 66 c:>setop 12 34 diff 12 56 67 78 setop 12 34