Assignments [ Assignment 2 ] - C Programming
ASSIGNMENT - 2
-------------------------------
Note: All the questios in this assignmens are based on if ... else ..
- Input a number and check this number is even or odd.
- Input the year [yyyy] and check whether this year is a leap year or not.
- Input a number and check this number is negative or positive number.
- 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.
- Input two numbers and check which number is greater.
- Write a C program to check whether a number is divisible by 5 and 11 or not.
- Input three numbers and check which the greatest number is.
- Enter the Real Price and Selling Price and then print whether it is profit or loss.
- Write a program to input a character and check whether the character is in lowercase or in uppercase.
- 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.
- Write a C program to input any alphabet and check whether it is vowel or consonant.
- Write a program to input the age of a person and check whether the person can cast his/her vote or not.
- 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?
- Write a program to input a value and check whether it is a digit, an alphabet, or an invalid character.
- MTNL [Mahanagar Telephone Nigam Limited] calculates the bill for the calls made. This uses the following rules.
- For first 200 calls no charge
- Calls more than 200 up to 300 Rs. 1.5 per call
- Call above 300 Rs. 2 per call – Now input number of calls from user and calculate the bill.
- Post Office Charges for the parcels to be sent across. The calculation of the charges for the parcel is as follow.
- Parcel up to 1 Kg in weight – Rs. 32
- Weight above the 1 Kg – Rs. 5 for each 100 Gms.
- Input the Weight of the parcel and calculate the parcel charges
- Write a C program to input basic salary of an employee and calculate its Gross salary according to following:
- Basic Salary <= 10000 : HRA = 20%, DA = 80%
- Basic Salary <= 20000 : HRA = 25%, DA = 90%
- Basic Salary > 20000 : HRA = 30%, DA = 95%
- 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
Comments
Post a Comment