Week 2 01
Week 2 01
Input Format
5 167.64 167.64
6
Question 2
Create a program that reads two integers, a and b, from the user. Your program should
Correct compute and display: • The sum of a and b • The difference when b is subtracted from
Marked out of a • The product of a and b • The quotient when a is divided by b • The remainder when
REC-CIS 5.00
a is divided by b
Flag question
Input Format
Output Format
Sample
Input 1 100 6
Sample Output
106 94 600 16 4
Question 3
A bakery sells loaves of bread for $3.49 each. Day old bread is discounted by 60
Correct percent. Write a program that begins by reading the number of loaves of day old
Marked out of bread being purchased from the user. Then your program should display the regular
7.00 price for the bread, the discount because it is a day old, and the total price. Each of
Flag question these amounts should be displayed on its own line with an appropriate label. All of the
values should be displayed using two decimal places.
Input Format
Output Format
Note: All of the values should be displayed using two decimal places.
Sample Input 1
10
REC-CIS
Sample Output 1
Discount: 20.94
Total: 13.96
Finish review
REC-CIS
. ________________________________________
OUTPUT
Print if he can be friend with Goki. 'YES' (without quotes) if he can be friends with Goki
else 'NO' (without quotes).
________________________________________
CONSTRAINTS
1<=N<=1000000
1<=X,Y<=1000000
SAMPLE INPUT 1
100 110
SAMPLE OUTPUT 1
REC-CIS
YES
SAMPLE INPUT 2
100 90
SAMPLE OUTPUT 2
NO
Question 2
Before the outbreak of corona virus to the world, a meeting happened in a room in
Correct Wuhan. A person who attended that meeting had COVID-19 and no one in the room
Marked out of knew about it! So everyone started shaking hands with everyone else in the room as a
5.00 gesture of respect and after meeting unfortunately everyone got infected! Given the
Flag question fact that any two persons shake hand exactly once, Can you tell the total count of
handshakes happened in that meeting? Say no to shakehands. Regularly wash your
hands. Stay Safe.
Input Format
Output Format
Print the number of handshakes.
Constraints
SAMPLE INPUT 1
SAMPLE OUTPUT
SAMPLE INPUT 2
SAMPLE OUTPUT 2
Explanation Case 1: The lonely board member shakes no hands, hence 0. Case 2: There
are 2 board members, 1 handshake takes place.
Answer: (penalty regime: 0 %)
REC-CIS
1 #include<stdio.h>
2 int main()
3 ▼ {
4 int n;
5 scanf("%d",&n);
6 n-=1;
7 printf("%d",n*(n+1)/2);
8 return 0;
9 }
1 0 0
2 1 1
Question 3 In our school days, all of us have enjoyed the Games period. Raghav loves to play
Correct cricket and is Captain of his team. He always wanted to win all cricket matches. But only
Marked out of one last Games period is left in school now. After that he will pass out from school. So,
7.00
Flag question this match is very important to him. He does not want to lose it. So he has done a lot
REC-CIS
of planning to make sure his teams wins. He is worried about only one opponent -
Jatin, who is very good batsman. Raghav has figured out 3 types of bowling
techniques, that could be most beneficial for dismissing Jatin. He has given points to
each of the 3 techniques. You need to tell him which is the maximum point value, so
that Raghav can select best technique. 3 numbers are given in input. Output the
maximum of these numbers.
Input:
SAMPLE INPUT
861
SAMPLE OUTPUT
81 26 15 81 81
Finish review