Answer the question
In order to leave comments, you need to log in
How to write a program in C?
Need help writing a C program. It is necessary to count the number of words in the line entered from the keyboard ending and beginning with the word entered from the keyboard. I will be grateful!
Answer the question
In order to leave comments, you need to log in
Now, in any case, it's too late to solve problems.
But, in general, first you need to get the first and last letter of the entered string and store them in variables.
Then, from the entered test string in a loop, until the end of the string is reached, check whether each character is a separator (space). This is how the word is extracted. If the first and last letters match the pattern, then the word counter is incremented.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question