Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

#Problem 1

Description:
You will take input three integer values, M, D, and Y denoting a particular date as a month, a
day, and a year respectively. You have to print the date in three separate formats in three
separate lines,
a) D/M/Y
b) D-M-Y
c) D.M.Y
Keep a new line character(‘\n’) after each print. Be careful about the printed spaces, as
there is no additional space in the output.

Limits:
1<=M<=12
1<=D<=31
0<Y<5000

Test Cases:
Input Output

2 14 2022 14/2/2022
14-2-2022
14.2.2022

7 15 2021 15/7/2022
15-7-2022
15.7.2022

#Problem 2
Description:
Each year consists of 365 days (or 366 days for leap year). In this problem, you are dealing
with a nonleap year having a total of 365 days starting from January 01 and ending on
December 31. You will be given an integer day number X. You have to print the desired day
and month for that particular day count X using the desired format “month/day”.

Keep a new line character(‘\n’) after each print.

Limits:
1<=X<=365

Test Cases:
Input Output

1 1/1
66 3/7

158 6/7

350 12/16

#Problem 3
Description:
You are given a series, S = 1+2+3+4+5+.........................+N. You will be given an integer value N, You
have to print the summation of the series.
Keep a new line character(‘\n’) after each print.
Limits:
1<=N<=1000

Test Cases:
Input Output

1 1

5 15

10 55

#Problem 4
Description:
You will write a code to solve the equation, A*x2 + B.X + C=0. You will be given 3 values A, B,
C. Each can be a floating-point value as input. Print two values after the decimal point and
you can print the values in any order. If the solution is not possible print “NONE” without the
quotes. Separate the outputs for each test case with a single blank space.
Keep a new line character(‘\n’) after each print.

Limits:
0<=|A|<=100
0<=|B|<=100
0<=|C|<=100

Test Cases:

Input Output

156 -3.00 -2.00

4 -4 -8 -1.00 2.00
111 NONE

#Problem 5
Description:
In this problem, you are going to solve the compound interest problem.

Initially, you have a principal amount P and an interest rate r (%). After the first year, the
principal gets updated to P(1+r/100), similarly, after the second year, it becomes P(1+r/100)
(1+r/100) and so on. You will be given P, r, and N denoting the initial principal amount, the
rate of interest in percentage, and the time after which you will report the final increased
principal amount up to two decimal places.

Limits:
0.00 < P < 1000.00
0<r<100.0
0<N<10

Test Cases:

Input Output

12.35 10.0 2 14.94

You might also like