hello guys, naa unta ko ipatan-aw ninyo kung unsa sayop or kulang ani nga codes. ang problem mao ni :
Make a program to input 10 names of student. Each student has 5 exam scores. Determine the average exam score of each student. Output the highest average exam score.
mao ni ang code :
#include<stdio.h>
#include<conio.h>
main()
{
int x,y;
char name;
float score;
int sum=0;
float ave=0,max=0;
for(x=1;x<=4;x++)
{
printf("Enter name %d : \n", x);
scanf("%s", &name);
sum = 0;
for(y=1;y<=5;y++)
{
printf("Enter score %d :", y);
scanf("%f", &score);
sum=sum+score;
}
ave=(sum/5);
printf("The average score is %.2f \n", ave);
}
if(ave>max)
max=ave;
printf("The highest average is %.2f", max);
getch();
}
ang problem man gud kay kung ako butangan apilido ang name or kanang naay space kay dli na xa mangayo pa sa ikaduha nga name din dli pud xa mu compute sa sakto na average for example mu input ko ug score na :
( 90+90+90+60.5+80.4 ) divided by
5 kay ang mu output niya kay
82.00 which is wrong dapat
82.12 unta.
i hope matabangan ko ninyo ani. salamat daan.