64 624
Assignments Done
99,1%
Successfully Done
In September 2018

Answer to Question #42235 in C++ for Yazid abubakar

Question #42235
write a c program that accept 10 student grade a calculate their average using microsoft visual c++
Expert's answer
#include <stdio.h>
#include <stdlib.h>
//main function
int main(int argc, char *argv[])
{
//variable for  average
double average;
//variable for sum
double sum=0;
//variable for grade
double grade;
int i;
//promt user to enter grade 
for( i=0;i<10;i++){
printf("Enter grade fro student %d: ",(i+1));
scanf("%lf",&grade);//read grade from keyboard
sum+=grade;//calculate sum
}
//calculate average
average=sum/10;
//show average
printf("Average = %.2lf\n\n",average);
//delay
system("PAUSE");
return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions