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

IF-ELSE Statements

1. Write a C program for analysis of people of certain age groups who are eligible for
getting a suitable job if their condition and norms get satisfied using nested if
statement.(age should be between 18 and 57)
2. Write a C program to check if three numbers are equal or not
3. Write a C program to find the max among three numbers
4. Write a C program to print if the given integer number is even and divisible by 6.
5. Write a C program to print the number of days for a given month (month: integer)
6. Write a C program to print if the given character is alphabet or not
7. Write a C program to print the grade for the subject based on the following criteria.

91-100 : O

81-90: A

71-80:B

61-70:C

50-60: D

<50: F

8.Write a C program to check whether a year is leap year or not.


9.Write a C program to input basic salary of an employee and calculate its Gross salary
according to following:
Basic Salary <= 10000 : HRA = 20% of basic salary, DA = 80% of basic salary
Basic Salary <= 20000 : HRA = 25% of basic salary, DA = 90% of basic salary
Basic Salary > 20000 : HRA = 30% of basic salary, DA = 95% of basic salary

Gross Salary = Basic Salary + HRA +DA

10. Write a C program to input electricity unit charges and calculate total
electricity bill according to the given condition:
For first 50 units Rs. 0.50/unit
For next 100 units Rs. 0.75/unit
For next 100 units Rs. 1.20/unit
For unit above 250 Rs. 1.50/unit
An additional surcharge of 20% is added to the bill
Switch Statements

1.Write a C program to print day of week name using switch case.

2.Write a C program print total number of days in a month using switch case.

3.Write a C program to check whether an alphabet is vowel or consonant using switch


case.

4.Write a C program to find maximum between two numbers using switch case.

5.Write a C program to check whether a number is even or odd using switch case.

6.Write a C program to check whether a number is positive, negative or zero using switch
case.

7.Write a C program to find roots of a quadratic equation using switch case.

8.Write a C program to create Simple Calculator using switch case.

9.Write a C program to find maximum between two numbers using switch case

10. Write a program to calculate the area of different geometrical figures like Circle,
triangle, trapezoid, square, and rectangle.

The program should ask the user to enter the code for which the user wants to find out the
area.

→ ‘t’ for triangle

→ ‘z’ for trapezoid

→ ‘c’ for circle

→ ‘s’ for square

→ ‘r’ for rectangle

You might also like