mardi 4 août 2020

Can I make enumerations of variables in if statemants?

I am trying to learn C++ (Beginner). But I wonder how I can make an enumeration of variables in statements like if.

Do I just put a comma between variables? What is the right syntax for this.. or is this all good?

#include <iostream>
using namespace std;

int main()
{
   int a, b, c, d, e;
   cin >> a >> b >> c >> d >> e;
   if (a, b, c > e && a, b, c > d) 
   {
      cout << a + b + c;
   }
}

Aucun commentaire:

Enregistrer un commentaire