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
What are the different data types in C?
How can you draw circles in C?
What is a char c?
How to get string length of given string in c?
What are the basic data types associated with c?
Explain what are the different file extensions involved when programming in c?
What is data structure in c and its types?
What are the rules for identifiers in c?
What is main () in c?
The program will first compute the tax you owe based on your income. User is prompted to enter income. Program will compute the total amount of tax owed based on the following: Income Tax 0 - $45,000 = 0.15 x income $45,001 - $90,000 = 6750 + 0.20 x (income – 45000) $90,001 - $140,000 = 15750 + 0.26 x (income – 90000) $140,001 - $200,000 = 28750 + 0.29 x (income – 140000) Greater than $200,000 = 46150 + 0.33 x (income – 200000) Dollar amounts should be in dollars and cents (float point numbers with two decimals shown). Tax is displayed on the screen.
any restrictions have on the number of 'return' statements that may be present in a function. a) no restriction b) only 2 return statements c) only 1 return statements d) none of the above
Explain how do you search data in a data file using random access method?
What is the scope of an external variable in c?
What are the loops in c?
What is #ifdef ? What is its application?