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

What is your favorite subject?

1 Answers   Ericsson, Invendis, Tech Mahindra,


HOW TO FIND OUT THE RREVERS OF A GIVEN DIGIT NUMBER IF IT IS INPUT THROUGH THE KEYBORD BY USING C LANGUAGE

3 Answers   Wipro,


What is const volatile variable in c?

0 Answers  


Write a program to print prime nums from 1-20 using c programing?

13 Answers   IBM,


What is function prototype in c with example?

0 Answers  


what does static variable mean?

0 Answers   TCS,


How to calculate Total working time using Login and logout?

2 Answers   CTS, Cygnus, Infosys, Signal Networks, TCS, Wipro,


which one is not preprocessor directive a)#if b)#elif c)#undef d)#pragma

16 Answers   Accenture, Infosys, TCS, Wipro,


How do I get an accurate error status return from system on ms-dos?

0 Answers  


wt is d full form of c

6 Answers   TCS, Wipro,


Write a C program to accept a matrix of any size. Find the frequency count of each element in the matrix and positions in which they appear in the matrix

0 Answers   CLG,


which is faster execution: loops or recursion?

3 Answers  


Categories