Programming Questions
1. Write a program to find the maximum between two numbers.
2. Write a program to find the maximum between three numbers.
3. Write a program to check whether a number is negative, positive, or zero.
4. Write a program to check whether a number is divisible by 5 and 11 or not.
5. Write a program to check whether a number is even or odd.
6. Write a program to check whether a year is a leap year or not.
7. Write a program to check whether a character is an alphabet or not.
8. Write a program to input any alphabet and check whether it is vowel or consonant.
9. Write a program to input any character and check whether it is the alphabet, digit, or special character.
10. Write a program to check whether a character is an uppercase or lowercase alphabet.
11. Write a program to input the week number and print the weekday.
12. Write a program to input the month number and print the number of days in that month.
13. Write a program to count the total number of notes in a given amount.
14. Write a program to input the angles of a triangle and check whether a triangle is valid or not.
15. Write a program to check whether the triangle is an equilateral, isosceles, or scalene triangle.
16. Write a program to find all roots of a quadratic equation.
17. Write a program to calculate profit or loss.
18. Write a program to input marks of five subjects Physics, Chemistry, Biology, Mathematics, and Computer. Calculate the percentage and grade according to the following:
Percentage >= 90% : Grade A
Percentage >= 80% : Grade B
Percentage >= 70% : Grade C
Percentage >= 60% : Grade D
Percentage >= 40% : Grade E
Percentage < 40% : Grade F
19. Write a program to input the basic salary of an employee and calculate its Gross salary according to the following:
Basic Salary <= 10000 : HRA = 20%, DA = 80%
Basic Salary <= 20000 : HRA = 25%, DA = 90%
Basic Salary > 20000 : HRA = 30%, DA = 95%
20. Write a program to input electricity unit charges and calculate total electricity bill according to the given condition:
For the first 50 units Rs. 0.50/unit
For the next 100 units Rs. 0.75/unit
For the next 100 units Rs. 1.20/unit
For units above 250 Rs. 1.50/unit
An additional surcharge of 20% is added to the bill
Theory Questions
1. What is the conditional statement
2. What is the if statement. How to use it.
3. What is the else statement. How to use it
4. What is the ladder
5. What is the nested- if statement.
6. What is the elif statement. How to use it?
7. What is the if -elif-else ladder
8. What is a short hand if-else statement. How to use it?