C/If.c
2024-05-13 11:09:46 -05:00

26 lines
336 B
C

#include <stdio.h>
#include <stdlib.h>
int main() {
float g; /* Grade */
/* Prompt the user */
printf("Enter the grade in percentage: ");
scanf("%f", &g);
/* Check if grade is > 60% */
if (g >= 60)
printf("Congratulations, your grade is passing.\n");
else {
printf("Sorry, try again.");
exit(1);
}
return 0;
}