Assignment 1
*WAP – Write a Program
1. WAP to read and print number which has following data type: char, int, short int, long int,
float, double, long double.
4
2. WAP to find volume of sphere = 3 𝜋𝑟 3
3. WAP to calculate net payment to any employee.
A company has following scheme for their staff:
Net Salary = Gross Salary - Deduction.
Gross salary = Basic +DA+HRA+MEDICAL.
Deduction = Insurance +PF. Where DA (deduction allowance) =50% of basic,
HRA (House Rent allowance) = 10% Basic,
Medical = 4% of Basic
PF (Provident Fund) = 5% of Gross Amount,
Insurance =7% of Gross.
4. WAP to compute Fahrenheit of Centigrade.
𝑇(°F) = 𝑇(°C) × 9/5 + 32
5. WAP for followings:
Take two numbers of float and divide the first number by second number and show
result as integer number.
Take two numbers of integer and divide the first number by second number and
show result as float number.
Take first number as -VE integer and second as +VE float, divide the first by second
and display output as integer number.
Take first number as +VE float and second number as -VE integer, divide the first
number by second and display output in float.
6. WAP to take two integer numbers and to perform the following operations onto given
numbers. Display the output of each operation.
Bitwise AND
Bitwise OR
Bitwise XOR
Bitwise Complement
Left Shift of given number
Right Shift of given number
Sizeof
7. WAP to find the maximum number from given two numbers with the help of ternary
operator.
8. WAP to perform following calculations on input number and print the output.
x = x++
x = ++x
x = x--
x = --x
x = x++ + x++
x = ++x + ++x
x = x++ + ++x
x = ++x + x++
x = x++ - x++
x = ++x - ++x
x = x++ - ++x
x = ++x - x++
Perform above all calculations for the decrement operator also.