I hv This Question here:
User will be prompt for number of quiz that has been taken.
User has to input their marks for each quiz.
Your program will calculate the average of the marks.
Find the lowest mark of those quizzes.
Find the 3 highest mark of those quizzes.
Those highest marks must be in order (from highest to lowest).
eg:
Number of quiz taken : 5
Please input mark for quiz 1: 10
Please input mark for quiz 2: 30
Please input mark for quiz 3: 20
Please input mark for quiz 4: 40
Please input mark for quiz 5: 60
Your average mark is 32.
Your lowest mark is 10.
The three highest marks for your quizzes are 60, 40, 30.
And i can just make it until :
#include<stdio.h>
int main()
{
int count,num;
float mark[10];
float total=0,avg;
float lowest,highest;
printf("Number of quiz taken : " );
scanf("%d",&num);
for(count=0;count<num; count++)
{
printf(" Please input mark for quiz %d: ",count+1);
scanf("%f",&mark[count]);
total=total+mark[count];
}
avg=total/num;
printf("Your average mark is %.2f.\n",avg);
lowest=mark[0];
for(count=0;count<num;count++)
{
if(mark[count] < lowest)
{
lowest=mark[count];
}
}
printf("Your lowest mark is %.2f.\n",lowest);
highest=mark[0];
for(count=0;count<num;count++)
{
if(mark[count] > highest)
{
highest=mark[count];
}
}
printf("Your highest mark is %.2f.\n",highest);
}
anybody tell me how to make the 2nd and 3rd highest marks?
i cant figure it out...
thanks...