/* write a program that first reads number of student in the class and finds the average B grade (B grade: 80 - 89) */ #include int main(){ int num_students, grade,i=0, sum_B=0, count_B=0; double ave_grade; printf("enter number of students\n"); scanf("%d",&num_students); if(num_students>0){ printf("entre %d grades\n", num_students); while(i=80 && grade<=89){ sum_B+=grade; count_B++; } i++; } if(count_B>0){ ave_grade=(double)(sum_B)/count_B; printf("there are %d students got B grade\n",count_B); printf("B grade average is %.1f\n",ave_grade); } else printf("no B grades\n"); } else printf("no students in this class\n"); return 0; }