here is my code. the question is- write a code to check weather a student is eligible to sit in the exam based on his/her attendance percentage. If the student has attendance percentage more than 75, he is eligible to sit in the exam otherwise, he/she will be asked weather he/she has a medical condition. if yes, he will be allowed otherwise not. Please help me out. I am unable to give input during if statement.
int main()
{
char response;
int clshld,per;
int clsatnd;
clshld = 330; //total no of class held
printf("no of class attended\n");
scanf ("%d", &clsatnd);
per=(clsatnd*100)/clshld; //percentage formula
printf ("\nattendence percentage is %d", per);
if (per<75)
{
printf ("\ndo you have a medical condition??");
scanf ("%c", &response);
if (response =='y')
{
printf ("\nyou can sit in the exam");
}
else
{
printf ("\nattendence too low ! you can't sit in the exam.'");
}
}
else
{
printf ("\nyou are eligible to sit in the exam.");
}
return 0;
}