24 lines
429 B
C
24 lines
429 B
C
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
|
|
int main() {
|
|
printf("Average Grade\n");
|
|
|
|
int g1, g2, g3; /* Grade 1, Grade 2, and Grade 3 */
|
|
|
|
|
|
printf("Enter Your First Grade: ");
|
|
scanf("%d", &g1);
|
|
|
|
printf("Enter Your Second Grade: ");
|
|
scanf("%d", &g2);
|
|
|
|
printf("Enter Your Third Grade: ");
|
|
scanf("%d", &g3);
|
|
|
|
printf("Average Grade = %.2f\n", (g1 + g2 + g3) / 3.0); /* calculates and prints the avergage grade */
|
|
|
|
return 0;
|
|
}
|
|
|
|
|