i want to find the highest and lowest of each person final results of percentage,sum,project,MID,Final and grade with searching method.
I do not understand what you mean because a lot of these data are unique for each person so how to speak about min/max on them ? Are you speaking about min/max among all the persons ?
Anyway some remarks on your code hopping they will help you
Warning the two lines
printf("Highest Value \t\t\t%15d %25d %11d %10d %10d\n",person[i].MaxPer,person[i].sum,person[i].project,person[i].MID,person[i].Final); printf("Lowest Value \t\t\t%15d %25d %11d %10d %10d\n",person[i].MinPer,person[i].sum,person[i].project,person[i].MID,person[i].Final);
are out of for ( i = 0; i < input; i++) {
so i values input and you access to not initialized values and may be out of person
In
scanf(“%d”,&input );
you do not check scanf returns 1 to know if the input was a valid number, you need also to check if input is less than 10 else you will access out of the array, anyway to also check the value is positive to indicate an error else seems a good idea.
Also check the other scanf to know if a valid input was done, never suppose a user enter a valid input
The fields MaxPer and MinPer do not exist but also in
person[i].MaxPer = person[i].percentage; printf("\n"); //input quiz for ( k = 0; k < 4; k++) { printf("Input Quiz%d : ",k ); scanf("%d",&person[k].quiz[i] ); count2+=person[k].quiz[i]; person[i].average = count2/4; } person[i].sum = person[i].average*0.10; person[i].MinPer = person[i].percentage;
person[i].percentage;
is unchanged so MaxPer and MinPer will have the same value
why are you setting person[i].average
in the loop rather than after ?
why *0.10
Same thing in
for ( j = 0; j < 3; j++) { printf("Input Assignment%d : ",j ); scanf("%d",&person[i].assignment[j] ); count+=person[i].assignment[j]; person[i].average = count/3; } person[i].percentage = person[i].average*0.20;
why are you setting person[i].average
in the loop rather than after ?
why person[i].average*0.20;
like if you managed 5 values ?
solved Find the highest and lowest value of each person if the person is more than one