2 - C Branching Assignment

You might also like

You are on page 1of 2

C

Assignment- 2

Cover: C Branching Statement

1. Write a program to input 2 no’s and use all relational operator to


find out relation.
2. Write a program to input a no and find out square root using sqrt().
3. Write a program to input character and change their case.(From
uppercase to lowercase or vice-versa) using isuuper/islower and
without it.
4. Write a program to find that entered year is leap year or not?
5. Write a program to find input number is even or odd?
6. Write a program to find largest no. between three no. using if-else.
7. Write a program to find input character is vowel or consonant using
switch.
8. Write a program to do arithmetic operation as desired using switch.

Address: PB-5, Block C, Top Floor, Mansarovar Complex, Shivaji Nagar, Bhopal, Madhya
Pradesh 462016
Phone: 0755 427 1659
9. Write a program to display a menu regarding rectangle operations
(area, perimeter, diagonal) and perform according to user’s
response.
10. Write a program for Celsius to Fahrenheit conversion ?
11. Read a no. and find out the even, odd no’s sum ?
12. Write a C program to input basic salary of an employee and
calculate gross salary according to given conditions:
Basic Salary <= 10000 : HRA = 20%, DA = 80%
Basic Salary is between 10001 to 20000 : HRA = 25%, DA = 90%
Basic Salary >= 20001 : HRA = 30%, DA = 95%
13. Write a program that read principal,amount,rate and duration
and calculate and print SimpleInterest.
a. If duration is greater than 5 years than decrease the rate by
2% ?
14.C program to check whether a character is Alphabet or Digit
or Other Graphical Character .

15. C program to check whether a number is odd or even using


conditional operator .

Address: PB-5, Block C, Top Floor, Mansarovar Complex, Shivaji Nagar, Bhopal, Madhya
Pradesh 462016
Phone: 0755 427 1659

You might also like