0% found this document useful (0 votes)
23 views9 pages

Day 1 - Extra Questions

Uploaded by

Karri Lokesh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views9 pages

Day 1 - Extra Questions

Uploaded by

Karri Lokesh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 9

Competitive

Coding

C Language Basics
Q1 – Debt Repay

Alice wanted to start a business and she was looking for a venture capitalist.
Through her friend Bob, she met the owner of a construction company who is
interested to invest in an emerging business. Looking at the business proposal,
the owner was very much impressed with Alice's work. So he decided to invest in
Alice's business and hence gave a green signal to go ahead with the project.
Alice bought Rs.X for a period of Y years from the owner at R% interest per
annum. Find the rate of interest and the total amount to be given by Alice to the
owner. The owner impressed by proper repayment of the financed amount
decides to give a special offer of 2% discount on the total interest at the end of
the settlement. Find the amount given back by Alice and also find the total
amount. (Note: All rupee values should be in two decimal points).
Q1 – Debt Repay
Input Format
Input consists of 3 integers.
The fi rst integer corresponds to the principal amount borrowed by Alice.
The second integer corresponds to the rate of interest .
The third integer corresponds to the number of years.
Output Format
The output consists of 4 fl oating point values.
The fi rst value corresponds to the interest.
The second corresponds to the amount.
The third value corresponds to the discount.
The last value corresponds to the fi nal settlement.
All fl oating point values are to be rounded off to two decimal places
Q1- Debt Repay

Sample Input-1 Sample


Output-1
100 10.00
1 110.00
10 0.20
109.80
Q2- The Misers Discount
Mrs. Bhulbhul is a miser to the core. She saves money even on petite
things.
One day she heard a discount off er announced in a mall.
She wants to purchase a lot of items to save her money. The discount
is given
only when at least two items are bought. Since each item has
diff erent
discount prices, she finds it diffi cult to check the amount she has
saved.
So she approaches you to device an automated discount calculator to
make her easy while billing.
Input Format
Input consists of two floating point values denoting price of item1 and
item2.
The third input denotes the discount value in percentage.
Output Format
The output consists of three floating values denoting
total amount, discounted price and amount saved.
Q2- The Misers Discount

Sample Input Sample Output


20.50 65.90
45.40 59.31
10 6.59
Q3- Booka The Alien
Booka is an alien. He couldn't understand how to measure days,
weeks, months and years. Make Booka understand what is meant
by days, weeks, months and years. Teach him about the
conversion of days into years, months and weeks using a
program.
Input Format
Input consists of an integer which corresponds to the number of
days.
Output Format
The output consists of three integers. The first integer
corresponds to the total years. The second integer corresponds
to the total weeks. The third integer corresponds to the total
days.
Sample Input Sample Output
373 1
1
1
Q4 – Treasure Hunter

Though there have been more successful pirates, Blackbeard is one of the
best-known and widely-feared of his time. He commanded four ships and had
a pirate army of 300 at the height of his career and defeated the famous
warship, HMS “Scarborough” in sea-battle. He was known for barreling into
battle clutching two swords with several knives and pistols at the ready. He
captured over forty merchant ships in the Caribbean and without flinching
killed many prisoners. Now, Blackbeard and his three pirates found a treasure
of gold coins. Long Ben too joined them. They decided to share the treasure.
Blackbeard agreed to give x% share for Long Ben. He then decided to take y%
share from the remaining treasure. His other pirates will share the remaining
gold coins equally. Write a program to compute their share's.
Q4 – Treasuer Hunter
Input Format
Input consists of 3 integers. The first input corresponds to the
number of gold coins in the treasure. The second input
corresponds to Ben's share percentage and the last input is
Blackbeard's share percentage.
Output Format
The output consists of three integers. The first output integer
corresponds to Long Ben's share. The second integer
corresponds to Blackbeard's share. The last integer
corresponds to other pirates share.
Sample Input Sample Output
729 473
65 222
87 11

You might also like