You are on page 1of 1

United International University

Department of Computer Science & Engineering(CSE)


Final, FALL-2020
Course Code: CSE 1110, Course Title: Intro. To CS

Time: 60 minutes Full Marks: 25

NB: Right margin indicates the full marks

1. Read the start time and end time of a game, in hours. Then calculate the duration of [5]
the game, knowing that the game can begin in a day and finish in another day, with a
maximum duration of 24 hours. The message must be printed “THE GAME LASTED X
HOUR(S)”

Input Output

16 2 The game lasted 10 hours


00 The game lasted 24 hours
2 16 The game lasted 14 hours
2. Write a program (WAP) that will print following series upto Nth terms. [10]
2, 6, 12, 20, 30, 42, 56, 72, 90, 110, 132, 156, 182, …….

Sample input Sample output


1 2
2 2, 6
3 2, 6, 12
4 2, 6, 12, 20

3. WAP to that reads an integer number N. Now find out if the reverse of that given number [10]
N is greater than the original number or not.
[Hint: Compare first and last digit to decide which number is greater].
Sample Input: Sample Output:
235 Reverse number 532 is greater
521 Reverse number 125 is smaller

You might also like