Q. Define a class to declare a character array of size ten, accept the character into the array and perform the following:
• Count the number of uppercase letters in the array and print.
• Count the number of vowels in the array and print.
Q. Define a class to declare an array of size 20 of double datatype, accept the elements into the array and perform the following:
• Calculate and print the sum of all the elements.
• Calculate and print the highest value of the array.
Q. Define a class to accept two strings, convert them into uppercase, check and display whether two strings are equal or not, if the two strings are not equal, print the string with the highest length or print the message both the strings are of equal length.
Q. Define a class to accept a string, convert it into lowercase and check whether the string is a palindrome or not.
A palindrome is a word which reads the same backward as forward.
Example:
madam, racecar etc.
Comments
Post a Comment