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>
int main() {
int first, second, third, average, total;
std::cout << "Enter 1st score: ";
std::cin >> first;
std::cout << "Enter 2nd score: ";
std::cin >> second;
std::cout << "Enter 3rd score: ";
std::cin >> third;
total = first + second + third;
average = total / 3;
std::cout << std::endl;
if(average >= 70){
std::cout << "PASSED" << std::endl;
} else {
std::cout << "FAILED" << std::endl;
}
return 0;
}
Comments
Leave a comment