Assignments [ Assignment 2 ] - C Programming

 ASSIGNMENT - 2 

  -------------------------------

Note: All the questios in this assignmens are based on if ... else ..

  1. Input a number and check this number is even or odd.
  2. Input the year [yyyy] and check whether this year is a leap year or not.
  3. Input a number and check this number is negative or positive number.
  4. Write a program to input a number and check whether this number is negative or positive. If negative change it into positive and if positive change it into negative.
  5. Input two numbers and check which number is greater.
  6. Write a C program to check whether a number is divisible by 5 and 11 or not.
  7. Input three numbers and check which the greatest number is.
  8. Enter the Real Price and Selling Price and then print whether it is profit or loss.
  9. Write a program to input a character and check whether the character is in lowercase or in uppercase.
  10. Write a program to input a character and check whether it is in lowercase or in uppercase. If in lowercase change it into uppercase. If in uppercase change it into lowercase.
  11. Write a C program to input any alphabet and check whether it is vowel or consonant.
  12. Write a program to input the age of a person and check whether the person can cast his/her vote or not.
  13. Write a program to input the age of a person and check whether the person can cast his/her vote or not. If not for how long, he/she has to wait?
  14. Write a program to input a value and check whether it is a digit, an alphabet, or an invalid character.
  15. MTNL [Mahanagar Telephone Nigam Limited] calculates the bill for the calls made. This uses the following rules.
    1. For first 200 calls no charge
    2. Calls more than 200 up to 300 Rs. 1.5 per call
    3. Call above 300 Rs. 2 per call – Now input number of calls from user and calculate the bill.
  16. Post Office Charges for the parcels to be sent across. The calculation of the charges for the parcel is as follow.
    1. Parcel up to 1 Kg in weight – Rs. 32
    2. Weight above the 1 Kg – Rs. 5 for each 100 Gms.
    • Input the Weight of the parcel and calculate the parcel charges
  17. Write a C program to input basic salary of an employee and calculate its Gross salary according to following:
    1. Basic Salary <= 10000 : HRA = 20%, DA = 80% 
    2. Basic Salary <= 20000 : HRA = 25%, DA = 90%
    3. Basic Salary > 20000 : HRA = 30%, DA = 95%
  18. Write a C program to input electricity unit charges and calculate total electricity bill according to the given condition:
    1. For first 50 units Rs. 0.50/unit
    2. For next 100 units Rs. 0.75/unit
    3. For next 100 units Rs. 1.20/unit
    4. For unit above 250 Rs. 1.50/unit
    5. An additional surcharge of 20% is added to the bill

Comments