C101 Laboratory Session 12

$30.00

Category: You will Instantly receive a download link for .zip solution file upon Payment || To Order Original Work Click Custom Order?

Description

5/5 - (2 votes)

Lab Goals 1) Practice in dealing with character arrays that end in the null terminator.
Write a program that ask user to enter any sentence, up to a maximum of 50 characters.
The program will then tell how many words are in the sentence and how many characters
are in the sentence. Do not count the null character. The program will then display the
sentence backwards. Program must use one function that will determine how many words
are in the sentence and pass this information back via a return value function. For this
program we will just define a word to be any sequence of characters delimited by white
space characters. So basically count the number of white spaces and increment it by one
to give the number of words.
Sample output follows:
Enter some sentence:
This is fun!
Your sentence has 3 words.
And your sentence has 12 characters.
Your sentence backwards is as follows:
!nuf si sihT