1.

Length and breadth of a rectangle are 5 and 7 respectively. Write a program to calculate the area and perimeter of the rectangle.

2.

Write a program to calculate the perimeter of a triangle having sides of length 2,3 and 5 units.

3.

Write a program to add 8 to the number 2345 and then divide it by 3. Now, the modulus of the quotient is taken with 5 and then multiply the resultant value by 5. Display the final result.

4.

Now, solve the above question using assignment operators (eg. +=, -=, *=).

5.

Write a program to check if the two numbers 23 and 45 are equal.

6.

Write a program to print the power of 7 raised to 5.

7.

Assign values of variables 'a' and 'b' as 55 and 70 respectively and then check if both the conditions 'a < 50' and 'a < b' are true.

8.

Now solve the above question to check if atleast one of the conditions 'a < 50' or 'a < b' is true.

9.

If the marks of Robert in three subjects are 78,45 and 62 respectively (each out of 100 ), write a program to calculate his total marks and percentage marks.

10.

Suppose the values of variables 'a' and 'b' are 6 and 8 respecrtively, write two programs to swap the values of the two variables.

1 - first program by using a third variable

2 - second program without using any third variable

( Swapping means interchanging the values of the two variables E.g.- If entered value of x is 5 and y is 10 then after swapping the value of x and y should become 10 and 5 respectively.)

1 - first program by using a third variable

2 - second program without using any third variable

( Swapping means interchanging the values of the two variables E.g.- If entered value of x is 5 and y is 10 then after swapping the value of x and y should become 10 and 5 respectively.)

11.

Write a program to convert Fahrenheit into Celsius.

12.

The total number of students in a class are 90 out of which 45 are boys. If 50% of the total students secured grade 'A' out of which 20 are boys, then write a program to calculate the total number of girls getting grade 'A'.

13.

Write a program to calculate the sum of the first and the second last digit of a 5 digit.

E.g.- NUMBER : 12345 OUTPUT : 1+4=5

E.g.- NUMBER : 12345 OUTPUT : 1+4=5

14.

Take a 4 digit number. Write a program to display a number whose digits are 2 greater than the corresponding digits of the number TAKEN.

For example, if the number which was taken is 5696, then the displayed number should be 7818.

For example, if the number which was taken is 5696, then the displayed number should be 7818.

15.

Write a program to calculate the sum of the digits of a 3-digit number.

Number : 132 Output : 6

Number : 132 Output : 6

16.

Write a program to reverse a 3-digit number. E.g.-Number : 132 Output : 231