#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
int main() {
char name[32];
int grade1;
int grade2;
int grade3;
int grade4;
char end[32]="unknown";
begin:
printf("Welcome to the student Quiz Calculator Program.\n");
printf("Enter a Student Name: ");
scanf("%s", &name[32]);
if(name == end){
goto terminate;
}
else {
printf("Enter quiz grade 1: ");
scanf("%d", &grade1);
printf("Enter quiz grade 2: ");
scanf("%d", &grade2);
printf("Enter quiz grade 3: ");
scanf("%d", &grade3);
printf("Enter quiz grade 4: ");
scanf("%d", &grade4);
printf("Average Quiz Calculation for %s with grades of %d, %d, %d, and %d is %d.\n", name, grade1, grade2, grade3, grade4, grade1+grade2+grade3+grade>
goto begin;
}
terminate:
printf("have a nice day");
return 0;
}
So I need this program to repeat its self continuously asking the user the name of the student, the grades and then outputting the average. When the user enters the name "Unknown", the program should give a good bye banner then terminate. When I run this, it doesn't recognize any names i put into it and it continuously repeats itself even when you input "Unknown", not sure how to straighten this out. I appreciate the help.
I messed with it a little using the goto/terminate/begin. but nothing seems to change the output.