Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

Conditional Statement

1. Write a program to check a given number is odd/even

2. Write a program that takes a number (1-7) and prints the corresponding day of the week.

3. Write a program that checks if a number is divisible by 2,3,both or neither.

4. Write a program that checks if a character is an alphabet, digit,or a special character.

5. Write a program to calculate the electricity bill based on the following rule

 For the first 100 units: Rs5.0 per unit

 For the next 100 unit :Rs7.50 per unit

 For units above 200 Rs.10.0 per unit

6. Write a program to calculate the body mass index (BMI) and determine the weight category

 BMI<18.5:Underweight

 18.5<=BMI<24.9:Normal Weight

 25<=BMI<29.9:Overweight

 BMI>=30:Obesity

7. Check if a year is century year(ending with 00)

8. Write a program to check if a given year is leap year or not

9. Check if a given string is palindrome or not

10. Write a program to check a given number is prime or not

11. Write a program to check if a given number is Armstrong number

12. Check if a given character is vowel or consonant.

13. Write a program that acts as a simple calculator,performing

addition,subtraction,multiplication,or division based on user input.

14. Check if a given number is divisible by both 3 and 5

You might also like