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
What do mean by network ?
What are Storage Classes in C ?
32 Answers CTS, HP, IBM, Maharaja Whiteline, Tamil Nadu Open University TNOU, TATA, TCS, Wipro,
If the size of int data type is two bytes, what is the range of signed int data type?
program to locate string with in a string with using strstr function
main() { charx; while (x=0;x<=255;x++) printf("\nAscii value %d Character %c,x,x); }
explain what is a newline escape sequence?
How can I read/write structures from/to data files?
WRITE A C PROGRAM TO FIND SECOND BIGGEST VALUE FROM THE GIVEN VALUES
What is wrong with this code such that it doesnt produce the input reversed? #include <stdio.h> #include <stdlib.h> #include <string.h> int main(void) { char Space = ' '; char LineOfText; float count; LineOfText = getchar(); while ((LineOfText = getchar()) != '/n'); { count = strlen(LineOfText) - 1; while (count >= 0) { putchar(LineOfText[count]); count--; } } getchar(); return 0; }
Explain the use of 'auto' keyword
x=2,y=6,z=6 x=y==z; printf(%d",x)
13 Answers Bharat, Cisco, HCL, TCS,
IS Doon college of Engn.. has good faculty