X Project Questions 24
X Project Questions 24
3 Write a program to compute the middle digit of a number entered. If the number
does not have a middle digit, it has to give the average of the two middle digits.
4 Write a menu driven program to perform the following operations using switch-
case:
(a) Input an integer number and print the greatest and the smallest digits
present in the
number.
Example:
Input: n=2943
Output: Greatest digit = 9 and Smallest digit = 2
(b) Input two number and find HCF (Highest Common Factor) of numbers.
Example: if numbers: 15, 21 then HCF: 3
A
if numbers: 16, 24 then HCF: 8
5 Write a menu driven program to perform the following operations using switch-
case:
a) Write a program to find the sum of the following series:
√an-1 + √an-3 + √an-5 up to n terms
6 Write a program to accept a word and Arrange all the alphabets of the word in its
alphabetical order and display the result.
Sample input: UNDERSTANDING
Sample output: ADDEGINNNRSTU
7 Write a menu driven program to perform the following operations using switch-
case:
(a) Print following pattern
1
13
133
1337
13375
(b) Write a program to enter a string and print the String in the following format:
Example: If given String s = "TIGER"
Output: R E G I T
REGI
REG
RE
R
8 Write a program to input a number and check given number is HAPPY. If sum of
B
squares of its digits is equal to 1. Repeat the process to sum of squares of digits
until either 1 or in any single digit.
For example 28 is HAPPY
(Working 22 +82 =68 , 62 +82 =100, 12 +02 +02 =1)
9 Write a program to enter a sentence. Replace the Lower Case Characters by # and
Upper
Case Characters by @
Input: Student Fail OR Pass
Output: @###### @### @@ @###
11 Write a program to find the roots of quadratic equation ax2+bx2+c=0 with the
following specifications:
12 Write a program to input a sentence. Count the number of times a particular word
occurs
in it. Display the frequency of the search word.
C
Sample Output: Frequency of the searched word : 2
13 Write a program to input a line of text from the user and create a new word formed
out
of the first letter of each word and convert the new word into Uppercase.
Example:
Input: Mangoes are delivered after Midday
Output: MADAM
14 Write a program to input a line of text from the user and convert into uppercase
letters. Display the words along with frequency of the words which have at least a
pair of consecutive letters.
Example:
Input: Modem is an electronic device
Output: MODEM
DEVICE
Number of words containing consecutive letters: 2
15 Write a program to input a string and convert into uppercase letters. Count and
display the number of words which has double letter sequences along with the
words.
Example:
Input: She was feeding the little rabbit with an apple
Output: FEEDING
LITTLE
RABBIT
APPLE
16 Write a program to input a string and convert into uppercase letters. Count and
display the palindrome words.
Example:
Input: Mom and Dad are not at home
Output: MOM
D
DAD
17 Write a program to input a string and convert into uppercase letters. Display the
word which has maximum number of vowels also display the number of vowels.
Example:
Input: Happy new year
Output: YEAR
Number of VOWELS: 2
18 Write a program to input a full name and display the abbreviations of the name
except the last word of the name.
Example:
Input: Mahendra Singh Dhoni
Output: M.S. Dhoni
19 Write a program to input a number and check given number is TECH. A number is
said to TECH If it has even number of digits, and when we split the number into
two halves then the square of sum of those halves is equal to number itself.
For example 2025 is TECH
(Working (20+25)2 =452 =2025)
20 Write a program to input a number and check given number is SUNNY. A number is
said to SUNNY If the square root of the next value of given number is a perfect
number.
For example 80 is SUNNY
(Working , Next value of is 80 =80+1=81, Square root of 81 =9, 81 is perfect square
of 9 , Hence 80 is SUNNY number )