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

Post New Answer

More C Interview Questions

write a program to swap two numbers without using temporary variable?

3 Answers  


Should I use symbolic names like true and false for boolean constants, or plain 1 and 0?

0 Answers  


int i=0,j; j=++i + ++i ++i; printf(" %d",j);

2 Answers   ME,


What is static memory allocation?

0 Answers  


What is a macro?

0 Answers  






How do you define CONSTANT in C?

0 Answers   ADP,


What is the output of the following program main();{printf ("chennai""superkings"}; a. Chennai b. superkings c. error d. Chennai superkings

6 Answers  


what is the height of tree if leaf node is at level 3. please explain

0 Answers  


where can function pointers be used?

2 Answers  


What is calloc()?

0 Answers   Adobe,


what will be printed by this printf? printf("%c",printf("hi")["sharkselva"])); }

3 Answers   HCL,


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

2 Answers   TCS, Tech Synergy,


Categories