Week 2 Assignment
Programs:
1. Write a program to take two numbers as input and perform subtraction, multipli-
cation, modulus and division on them.
2. Write a program that takes the length and breadth of a rectangle as input and
calculates its area and perimeter.
Hint: Area = length * breadth
Perimeter = 2 * (length + breadth)
3. Write a program to print the ASCII value of a character.
4. Write a program to accept student roll no, marks in 3 subjects and calculate total,
average of marks and print them with appropriate messages.
5. Write a program that takes two integer inputs and performs bitwise AND, OR, and
XOR operations on them, displaying the results.
6. An Employee’s Basic Pay (BP) is to be read through a keyboard. DA is 40%
of BP, HRA is 20% of BP, calculate the Gross Pay (GP) GP is computed as
BP+DA+HRA.