LAB - 3.1 Bscs Fall 2020: Introduction To Computing
LAB - 3.1 Bscs Fall 2020: Introduction To Computing
LAB – 3.1
BSCS FALL 2020
Sample Input:
12, 20, 5
Expected Output:
The reverse of 12 , 20 and 5 is 5, 20 and 12
b) Get hours and minutes as input from user, and calculates the total number of
minutes.
Expected Output:
Input hours: 5
Input minutes: 37
Total: 337 minutes.
c) Get minutes as input from user, and display the total number of hours and
minutes.
Expected Output :
Input minutes: 546
9 Hours, 6 Minutes
TASK – 02
You have to write a C++ program that will have two variables [x and y] both integer, you have
to assign some value to the both variables, and then you have to show [Let x = 25, y = 13]
Sum = x + y
Sub = x – y
Sub1 = y – x
Mul = x * y
Div = x / y
Div1 = y / x
Output on the screen should remain the same as before now think where you have to
use variables to show the results.
Now again update the program and get value of x and y as an input from the user
Repeat the other case for the output; use the other variables [Sum, Sub, Sub1, Mul, Div,
Div1] for storing result
TASK – 03
You have to write a C++ program that will find the perimeter and area of a rectangle. To find the
perimeter and area of a rectangle, you need to know the rectangle’s length and width.
You have to define two variables [length and width] and assign values to both. You
have to calculate
Output should be
Change this program and get both length and width values from the user as an input.
Output should be