This is the unary operator problem I am facing, and I fail to understand why VSCode gives output 8,13 when turbo c gives out the answer 8,15?
#include<bits/stdc++.h>
using namespace std;
int main()
{
int a;
a = 2;
cout<<++a + ++a; //This is displaying 8 which is understood
a = 2;
cout<<endl<<++a + ++a + ++a; //Why is this displaying 13, shouldn't it be 5+5+5=15?
}
Aucun commentaire:
Enregistrer un commentaire