/*
Write a program to accept a sentence as
input. The words in the string are to be separated by a blank.
Each word must be in upper case. The
sentence is terminated by either '.','!' or '?'.
Perform the following tasks:
1. Obtain the length of the sentence
(measured in words)
2. Arrange the sentence in alphabetical
order of the words.
Test your program with the sample data
and some random data:
Example 1:
INPUT: NECESSITY IS THE MOTHER OF
INVENTION.
OUTPUT:
Length: 6
Rearranged Sentence:
INVENTION IS MOTHER NECESSITY OF THE
Example 2:
INPUT: BE GOOD TO OTHERS.
OUTPUT:
Length: 4
Rearranged Sentence: BE GOOD OTHERS TO
*/
// ISC Computer Science Practicals,
2012
No comments:
Post a Comment