Sunday, February 15, 2009

CS 121 EXER6

Photobucket



#include#includevoid main(){ clrscr();float grade,average,sum;int a=0;while(grade!=-1){ sum=sum+grade;printf("\n\n_-_-_-_-_-_-_-_-_-_-_"); printf("\nEnter grade; -1 to exit");scanf("%f",&grade);if(grade==-1){printf("\n\n\n\t\t\t.,.,.,.,.,.,.,.,.,.,.,.");printf("\n\t\t\tAverage is %.2f\n",average=sum/a);}a++;}if(average>=95 && average<=100){printf("\n\nRated of this average: A");}else if(average>=90 && average<=94){printf("\n\nRated of this average: B");}else if(average>=89 && average<=90){printf("\n\nRated of this average: C");}getch();}

No comments:

Post a Comment