C/If.c

27 lines
336 B
C
Raw Normal View History

2024-05-13 18:09:46 +02:00
#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;
}