Wednesday 9 March 2016

Blood bank


A team from Rotract club had planned to conduct a rally to create awarness among the coimbatore people to donate blood. They conducted the rally successfully . Many of the coimbatore people realized 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 weight in system. If a person is eligible he / she will be allowed inside.

Write a program and feed it to the system to find whether a person is eligible or not.

Input Format: 
Input consists of two integers which corresponds to age and weight of a person respectively. 

Output Format : 
Display whether the person is eligible or not. 

Sample input and output 1: 
[All text in bold corresponds to input and the rest corresponds to output] 
Enter your Age: 
19 
Enter your Weight: 
50 
Eligible to donate. 

Sample input and output 2: 
Enter your Age: 
17 
Enter your Weight: 
50 
Not Eligible to donate.

Code:
  #include<stdio.h>
int main(){
  int age,w;
  printf("Enter your Age:\n");
  scanf("%d",&age);
  printf("Enter your Weight:\n");
  scanf("%d",&w);
  if((age>18)&&(w>40))
    printf("Eligible to donate.");
  else
    printf("Not Eligible to donate.");
  return 0;
}
  

1 comment:

  1. I was surfing net and fortunately came across this site and found very interesting stuff here. Its really fun to read. I enjoyed a lot. Thanks for sharing this wonderful information.
    blood bag centrifuge

    ReplyDelete