Conditions Interactive PDF
Conditions Interactive PDF
(Total 15 questions)
3. Program that will take an integer of length one from the terminal and then display the digit *
in English.
4. Program that will check whether a triangle is valid or not, when the three angles (angle value *
should be such that, 0 < value < 180) of the triangle are entered through the keyboard.
[Hint: A triangle is valid if the sum of all the three angles is equal to 180 degrees.]
6. Program that will read from the console a random number and check if it is a nonzero ***
positive number. If the check is yes, it will determine if the number is a power of 2.
If the check fails the program will check for two more cases. If the number is zero, the
program will print “Zero is not a valid input”. Else it will print “Negative input is not valid”.
7. Program that will take two numbers X & Y as inputs and decide whether X is greater *
than/less than/equal to Y.
9. Program that will categorize a single character that is entered at the terminal, whether it is *
an alphabet, a digit or a special character.
11. Program that will take the final score of a student in a particular subject as input and find *
his/her grade.
12. Program that will construct a menu for performing arithmetic operations. The user will give *
two real numbers (a, b) on which the arithmetic operations will be performed and an integer
number (1 <= Choice <= 4) as a choice. Choice-1, 2, 3, 4 are for performing addition,
subtraction, multiplication, division (quotient) respectively.
13. Program that will construct a menu for performing arithmetic operations. The user will give **
two real numbers (a, b) on which the arithmetic operations will be performed and an integer
number (1 <= Choice <= 4) as a choice. Choice-1, 2, 3, 4 are for performing addition,
subtraction, multiplication, division respectively.
If Choice-4 is selected, again the program will ask for another choice (1 <= Case <=2), where
Case-1, 2 evaluate quotient and reminder respectively.
14. Program that will construct a menu for performing arithmetic operations. The user will give ***
two real numbers (a, b) on which the arithmetic operations will be performed and an integer
number (1 <= Choice <= 4) as a choice. Choice-1, 2, 3, 4 are for performing addition,
subtraction, multiplication, division respectively.
If the check is true, the program will ask for another choice (1 <= Case <=2), where Case-1, 2
evaluate quotient and reminder respectively. If the check is false, it will print an error
message “Error: Divisor is zero” and halt.