#include<stdio.h>
int main(){
float gpa, afi, shr;
printf("Enter your GPA:");
scanf("%f",&gpa);
printf("Enter your annual family income:");
scanf("%f",&afi);
printf("Enter your service hours:");
scanf("%f",&shr);
printf("n---------------");
printf("nSCHOLARSHIP DETAILS");
printf("n---------------");
printf("nGPA: %.2f", gpa);
printf("nAnnual Family Income: %.2f", afi);
printf("nCommunity Servuce Hours: %.2f", shr);
if(gpa<=3.5){
if(afi<=400000){
if(shr>=50){
printf("nScholarship Status: Awarded");
}else{
if(shr < 50){
printf("nScholarship Status:Denied(Insufficient service hours)");
}
}
}else{
if(afi > 400000){
printf("nScholarship Status:Denied(Family Income is too high)");
}
}
}
}else{
if(gpa > 3.5){
printf("nScholarship Status:Denied(GPA is too low)");
}
}
I expected my code to work and produce the expected output.
New contributor
Daphne Axalan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1