BLOOD BANK
Problem Description
A team from SRM Rotaract club had planned to conduct rally to create awareness among the chennai people to denote blood. They conducted the rally successfully. Many of the chennai people realise it and came forward to donate their blood to near by blood bank. The eligibility criteria for donating blood is people should be above 18 and his her weight should be above 40. There was a huge crowd and staff in blood bank found it difficult to manage the crowd. So they decided to keep a system and ask the people to enter their age and weigh in a system. If a person is eligible he /she will be allowed inside.
Write a C program and feed it to the system to find whether a person is eligible or not.
Input format:
Input consists of 2 integers which corresponds to age and weight of a person respectively.
Output Format:
Display whether person is eligible or not.
CODING ARENA
#include <stdio.h>
int main()
{
int a,b;
scanf("%d%d",&a,&b);
if(a>18 && b>40)
printf("Eligible to donate");
else
printf("Not Eligible to donate");
return 0;
}
Test Case 1
Input (stdin)19
41
Expected Output
Eligible to donate
Test Case 2
Input (stdin)18
40
Expected Output
Not Eligible to donate
No comments:
Post a Comment