Calculating grades of “N” students from 3 tests.
Sample data: No of students : 3
Enter 3 scores for student1: 67 56 43
Enter 3 scores for student2: 56 78 89
Enter 3 scores for student3: 87 54 75
S.No. score1 score2 score3 Ave Grade
----------------------------------------------------------------------------------
1. 67 56 43 55 C
2. 56 78 89 74 B
3. 87 54 75 72 B
-----------------------------------------------------------------------------------*/
#include
#include
void main()
{
int n,m1[100],m2[100],m3[100],i;
float avg[100];
char grade[100];
clrscr();
printf("Enter the total number of students: ");
scanf("%d",&n);
for(i=0;i
printf("\nEnter 3 scores of student%d :",i+1);
scanf("%d %d %d",&m1[i],&m2[i],&m3[i]);
}
for(i=0;i
avg[i]=(m1[i]+m2[i]+m3[i])/3;
if(avg[i]>=75)
grade[i]='A';
else if(avg[i]>=60 && avg[i]<75)
grade[i]='B';
else if(avg[i]>=45 && avg[i]<60)
grade[i]='C';
else
grade[i]='F';
}
printf("S.NO\tscore1\tscore2\tscore3\tavg");
for(i=0;i
printf("\n%d\t%d\t%d\t%d\t%f\t%c",i+1,m1[i],m2[i],m3[i],avg[i],grade[i]);
}
getch();
}
/* Output
Enter the total number of students: 2
Enter 3 scores of student 1 :63
69
65
Enter 3 scores of student 2 :63
64
61
S.NO score1 score2 score3 avg
1 63 69 65 65.000000 B
2 63 64 61 62.000000 B
*/
Shopping In MUMBAI
Are you searching for Discounts, offers, sale in Mumbai ? You are in the right place. MUMBAI, a shopping haven, has no dearth of great discounts and sales. This blog features the best MUMBAI shopping offers, sale, discounts and deals and bargains CURRENTLY GOING on in Mumbai plus a few free things thrown in on top.
Don't wait for it because once they are gone, they are gone. Hurry!..By clicking the "Like" button you will receive a daily update of discounts, sale, offers going on in Mumbai. LIKE IT.... SHARE IT...njoY.
Wednesday, December 31, 2008
C Program for Calculating grades of “N” students from 3 tests
Posted by ars at 10:59 AM
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment