Saturday, 5 March 2022

9. Write a program to check whether the blood donor is eligible or not for donating blood. The conditions laid down are as under. Use if statement. a) Age should be above 18 yrs but not more than 55 yrs.



#include<stdio.h>
#include<conio.h>

void main()
{
    int age;
    clrscr();

    printf("enter your age: ");
    scanf("%d",&age);

    if(age>18 && age<57)
    {
        printf("\nyour eligible for donating blood");
    }
    else
    {
        printf("\nyour not eligible for donating blood");
    }
    getch();
}

/*   output:

enter your age: 45

your eligible for donating blood

*/ 

No comments:

Post a Comment

python programs

1. sum of two number