Compute the total quiz and average quiz of three (3) scores. Determine if the average score is greater than or equal to 70, if TRUE , display Remarks is “ PASSED” otherwise display “FAILED”.
#include <iostream>
#include <string>
#include <conio.h>
using namespace std;
int main(void){
int score;
int sum=0;
for(int i=0;i<3;i++){
cout<<"Enter score "<<(i+1)<<": ";
cin>>score;
sum+=score;
}
float average=(float)sum/3.0;
if(average>=70){
cout<<"\nPASSED\n\n";
}else{
cout<<"\nFAILED\n\n";
}
system("pause");
return 0;
}
Comments
Leave a comment