E-BOX
BASICS OF C PROGRAMMING
Conditional Statements :- Code Analysis
PROBLEM - 2
A Task
A task is given to 3 persons to complete it within a particular time. If the person exceeds the time limit he will be disqualified. Only those who complete it within the given time is qualified.Among the qualified persons, the person who completes the task first will be rewarded.
Write a program to find the person who is rewarded.
Input Format:
First input corresponds to the Time limit for the task in hours. Second,Third and Fourth Inputs
correspond to the number of hours Taken by the first , second and third persons respectively to
complete the task.
Output Format:
Display the person who completes first.
All text in bold corresponds to input and the rest corresponds to output]
Sample Input and Output 1:
Time Limit:
10
Time taken by first person:
5
Time taken by second person:
6
Time taken by third person:
4
Third person wins!!!
Sample Input and Output 2:
Time Limit:
5
Time taken by first person:
3
Time taken by second person:
6
Time taken by third person:
4
First person wins!!!
Sample Input and Output 3:
Time Limit:
4
Time taken by first person:
9
No comments:
Post a Comment