vendredi 20 juillet 2018

Why the output of this program is 10?

#include <iostream>
using namespace std;

int main(){
    int a = 1;
    a = ++a + ++a + ++a;
    cout<<a;
}

Value of variable a is 10, but what I know it should be 9.

Aucun commentaire:

Enregistrer un commentaire