I'm having aproblem with my code, I would like to add another data up to 5 names with three grades each but I don't know how. This is my code
#include <stdio.h>
#include <conio.h>
main()
{
unsigned char studname[30];
float prelim,midterm,final,average;
int total;
{
clrscr();
gotoxy(2,4);
printf("Please Enter Your Name: ");
gets(studname);
gotoxy(2,6);
printf("Prelim Grade: ");
gotoxy(19,6);
scanf("%f",&prelim);
gotoxy(2,8);
printf("Midterm Grade: ");
gotoxy(19,8);
scanf("%f",&midterm);
gotoxy(2,10);
printf("Final Grade: ");
gotoxy(19,10);
scanf("%f",&final);
total=prelim+midterm+final;
average=total/3;
gotoxy(2,12);
printf("Your Average is %f",average);
gotoxy(2,12);
scanf("%s",&studname);
getche();
}}
I'm not sure if I'm gonna use for loop or while. Any suggestions woud be of great help. Thanks