Write a program to find the number of times that a given word(i.e. a short string) occurs in a sentence (i.e. a long string!).
Read data from standard input. The first line is a single word, which is followed by general text on the second line. Read both up to a newline character, and insert a terminating null before processing.
Typical output should be:
The word is "the".
The sentence is "the cat sat on the mat".
The word occurs 2 times.
No Answer is Posted For this Question
Be the First to Post Answer
write a program to swap two numbers without using temporary variable?
Should I use symbolic names like true and false for boolean constants, or plain 1 and 0?
int i=0,j; j=++i + ++i ++i; printf(" %d",j);
What is static memory allocation?
What is a macro?
How do you define CONSTANT in C?
What is the output of the following program main();{printf ("chennai""superkings"}; a. Chennai b. superkings c. error d. Chennai superkings
what is the height of tree if leaf node is at level 3. please explain
where can function pointers be used?
What is calloc()?
what will be printed by this printf? printf("%c",printf("hi")["sharkselva"])); }
how does the C compiler interpret the following two statements p=p+x; q=q+y; a. p=p+x; q=q+y b. p=p+xq=q+y c. p=p+xq; q=q+y d. p=p+x/q=q+y