68 231
Assignments Done
99%
Successfully Done
In November 2018

Answer to Question #13977 in C++ for mac eleazar

Question #13977
write a C++ program that would input 10 grades and output the total passed and total failed.
Expert's answer
#include <iostream>




using namespace std;




void main(){

int passed=0, failed=0, grade;

for(int i=1; i<11; i++){

cout << "Grade #" << i << ": ";

cin >> grade;

if(grade < 3)

failed++;

else

passed++;

}

cout << endl << "Total passed: " << passed;

cout << endl << "Total failed: " << failed;

cout << endl;

}

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