Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

Write the program for the following questions:

1. Write a program that will calculate the Perimeter and Area of a rectangle given its length
and width (Hint: The formula for Rectangle’s Area is Length X Width. Formula for
Rectangle’s Perimeter is 2*Length + 2 * Width.
Sample Output:
Enter Length: 5
Enter Width: 3
Perimeter: 16
Area: 15

2. Write a program that will calculate the sum, difference, product, and quotient of 2 given
integer numbers.
Sample Output:
Enter first number: 3
Enter second number: 2
Sum: 5
Difference: 1
Product: 6
Quotient: 1

3. Write a program in C++ to compute quotient and remainder.


Sample Output:
Input the dividend : 25
Input the divisor : 3
The quotient is : 8
The remainder is : 1

You might also like