QUESTION DESCRIPTION :
Ms.Kirthiga, the faculty handling programming lab for you is very strict. Your seniors have told you that she will not allow you to enter the weeks lab if you have not completed atleast half the number of problems given last week. Many of you didnt understand this statement and so they requested the good programmers from your batch to write a c program to find whether a student will be allowed into a week lab given the number of problems given last week and the number of problem solved by the students in that week.
Input format:
Input consists of 2 integers. The First integer corresponds to the number of problems given and the second integer corresponds to the number of problems solved.
Output format:
Output consists of the string "IN" or "OUT"
Refer sample input and output for further formatting specifications.
TEST CASE 1
INPUT
8
3
OUTPUT
OUT
EXPLANATION :
The code requires you to check weather a person is eligible to enter the LAB or not.
The entry criteria is that a person should have completed at least 50% or half of the problems given to them last week.
The input consists of 2 numbers , first one is the number of problems given to the person last week and second is the number of problems done by him/her.
Check if the person has done 1/2 or more problems and print IN or OUT according to the condition.
ALGORITHM :
Ms.Kirthiga, the faculty handling programming lab for you is very strict. Your seniors have told you that she will not allow you to enter the weeks lab if you have not completed atleast half the number of problems given last week. Many of you didnt understand this statement and so they requested the good programmers from your batch to write a c program to find whether a student will be allowed into a week lab given the number of problems given last week and the number of problem solved by the students in that week.
Input format:
Input consists of 2 integers. The First integer corresponds to the number of problems given and the second integer corresponds to the number of problems solved.
Output format:
Output consists of the string "IN" or "OUT"
Refer sample input and output for further formatting specifications.
INPUT
8
3
OUTPUT
OUT
EXPLANATION :
The code requires you to check weather a person is eligible to enter the LAB or not.
The entry criteria is that a person should have completed at least 50% or half of the problems given to them last week.
The input consists of 2 numbers , first one is the number of problems given to the person last week and second is the number of problems done by him/her.
Check if the person has done 1/2 or more problems and print IN or OUT according to the condition.
ALGORITHM :
- Input two integers from the user ( a,b )
- Check if questions done is more than 1/2 of the questions given ( b>=(int)(a/2) )
- If the condition is true ,print IN
- Otherwise print OUT
SOLUTION : (Please use this as reference only)
CODE |
No comments:
Post a Comment