Computer Science, asked by dhanvi732, 20 days ago

(a) Write a program to accept the age of the user and check for the following criteria: 1. If the age of the user is greater than or equal to 65, then print the following statement (Congratulations! You are eligible to avail the facilities of a Senior Citizen.). it. If the age is between 18 to 64, print the following statement (Sorry! You are not a Senior Citizen. You are not eligible to avail the facilities.). iii. If the age of the user is less than 18, print the following statement (Sorry! You are not an adult yet.).​

Attachments:

Answers

Answered by rajdheerajcreddy
6

Answer:

#include <stdio.h>

#include <stdlib.h>

void main()

{

   int age;

   

   printf("Enter your age: ");

   scanf("%d",&age);

   

   if(age>=65){

       printf("Congratulations! You are eligible to avail the facilities of a Senior Citizen.");

   }else if(age>=18 && age<65){

       printf("Sorry! You are not a Senior Citizen. You are not eligible to avail the facilities.");

   }else if(age<18){

       printf("Sorry! You are not an adult yet.");

   }

}

Answered by niteshrajputs995
1

Answer:

Given below is the answer

Explanation:

We need to write a program which will accept an integer called age. Depending on the age,

If age is greater than 65 then the person is a senior citizen.

If age between 18 and 64 then Not a senior citizen yet.

else then he is not an adult yet.

void agecheck()

{

int age;

printf(" Enter the age: " );

scanf(" %d", &age);

if( age > = 65 )

printf(" Congratulations! You are eligible to avail the facilities of a Senior Citizen ");

else if( age > = 18)

printf(" Sorry! You are not a Senior Citizen. You are not eligible to avail the facilities. ");

else

printf(" Sorry! You are not an adult yet. ");

}

Similar Problems

brainly.in/question/9599693

#SPJ3

Similar questions