// editor2
#include<stdio.h>
int main(){
int age;
//prompt user for input
printf("Enter the age;");
//Read the integer input
if(scanf("%d",&age)!=1){
    //Handle non-integer input error
    printf("invalid input\n");
  return 1;//Return non-zero to indicate error 
}
//---Eligibillity Logic---
//1.Check for Invalid Input(Negative age)
if(age<0){
    printf("Invalid input\n");
}
//The contraints section(1,=age<=120)seems to conflict with the
//"print Invalid input if the age is negative"rule,as age<1is out
//A strict implementtion of the constrain 1<=age<=120.
//would make any age<1 or age.120Invalid/out of range
//2.check for Eligibility(Age 18 or above)
else if(age>=18){
    print("Eligibile\n");
}
//3.check for non-Eligible(Age below 18 but not negative)
else{//This convers age0 to 17(or 1to 17 if strictiy following constraints)
printf("Not eligible\n");
}
return 0;//Return 0 to indicate successful execution
}