hi i need a help, how to create a program that will compute the average grade of the student with 3 inputted quizes. they didn't teach us the input/utput.
1
Expert's answer
2013-06-24T11:52:57-0400
#include <iostream> #include <conio.h>
using namespace std; //mina function int main() { int arrayofgrade[3]; //input number for(int i=0;i<3;i++){ cout<<"Enter quiz "<<(i+1)<<": "; cin>>arrayofgrade[i]; } //declare variable float sum=0; float average=0; //fin sum for(int i=0;i<3;i++){ sum+=arrayofgrade[i]; } //calculate average average=sum/3; //show Average cout<<" Average is: "<<average; getch();//delay return 0; }
Comments
Leave a comment