Assignment 3: Operators & Expression
___________________________________________________________
1. Write a program to perform addition, subtraction, multiplication and division between
two numbers.
2. Write a c program to find the area of the right angle triangle.
3. Write a program to swap two numbers with and without using a temporary variable.
4. Write a c program to input the value of rupees and convert into paisa.
5. Write a c program to input the distance traveled by a car and the time taken. Display its
speed.
6. Write a program that takes distance in inches and prints the corresponding value in cms.
(Note that 1 inch = 2.54 cm)
7. Write a c program to shift the given data by two bits to the left.
8. Write a c program to perform multiplication of given number with two without using *
operator.
9. Write a c program to read age as input. If age>18 then print “you can vote” else “you are
not eligible to vote” using ternary operator.
10. Write a c program to print the storage sizes of int, char and float data types.
11. Write a program to input the value of 4 variables a, b, c and d. Compute the resultant
value of the following expressions:
a. (a+b) * (c /d)
b. (a + b) * c / d
c. a+(b*c) / d