What is grade in the following program? | Sololearn: Learn to code for FREE!

0

What is grade in the following program?

#include <iostream> using namespace std; int main() { int age = 20; int grade = 80; if (age > 16 && age < 60 && grade > 50) { cout << "Accepted!" << endl; } return 0; }

11/22/2016 8:26:25 AM

neil

1 Answer

New Answer

+3

How I see it, grade is 80 and it is more than 50 in your condition so it pass. Age is 20 and it is more than 16 and less than 60. In your if statement all tree conditions need to be true and in your case they are.... so it will write out Accepted!...