A) Variables Shortage!
Write a program that takes 5 integers from the user and displays their sum on screen. But you can
only use two variables. (Use While Loop)
Input:-
The first line contains 5 Numbers.
Output:-
Display The Sum of All Five Numbers.
Sample Test Cases:-
1. 1 2 3 4 5
2. -12 -4 5 7 1
Sample Output:-
1. 15
2. -3
B) Who I’m?
Depending on age (decimal number and gender (m / f), print a personal title:
● “Mr.” – a man (gender “m”) – 16 or more years old.
● “Master” – a boy (gender “m”) under 16 years.
● “Ms.” – a woman (gender “f”) – 16 or more years old.
● “Miss” – a girl (gender “f”) under 16 years.
Test Cases:-
1)
Enter your age: 18
Enter your Gender (m/f): m
Your personal title is : Mr
2)
Enter your age: 12
Enter your Gender (m/f): f
Your personal title is : Miss
C) Can You Guess The Password?
PUCIT's Programming Fundamentals Lab has locked the final exam password inside a
mathematical expression. He claims that only students who truly understand characters and
numbers can unlock it!
Your task is to evaluate the following secret expression:
Result=(B−A)×(C/D)+(F-E)
But wait! The values aren’t directly given! Instead, you must extract them from characters as
follows:
A → ASCII value of the first letter in “PUCIT”
B → ASCII value of the last letter in “PUCIT”
C → ASCII value of ‘P’ plus ASCII value of 'U'
D → Total letters in “PUCIT”
E → ASCII value of 'C'
F → ASCII value of 'T'
Input Format:
No input required! Your program should directly compute the values.
Output Format:
Print the computed Result based on the formula.