mercredi 23 décembre 2020

Check multi veriables in if condition [duplicate]

float math , physics ,literature , chemistry ;

cout << "Enter math score : ";
cin >> math ;
cout << "Enter physics score : ";
cin >> physics ;
cout << "Enter chemistry score : ";
cin >> chemistry ;
cout << "Enter literature score : ";
cin >> literature ;

I want to check my variables but it didnt worked....

//Check inputs
if ( math , physics , chemistry , literature > 20 ){
    cout << "Error ... The score should be in range (0,20).";

Aucun commentaire:

Enregistrer un commentaire