+ 2

What is the output of this code?Also please explain the compelete solution 🙂

int x=2; int main(){ int x=4; { int x=8 cout<<x } cout<<x cout<<::x return 0; }

28th Jul 2017, 4:12 AM
Vinayak Agrawal
Vinayak Agrawal - avatar
4 odpowiedzi
+ 1
Take a look: https://code.sololearn.com/cQFGreZF34dV/?ref=app It was lacking the #include and namespace std statement as well as some semicolons. That's why it's good to share the code written in Code Playground, it helps a lot. Result: 842 The explanation is in the comments I wrote in code
28th Jul 2017, 4:32 AM
Tiago Soares
Tiago Soares - avatar
+ 1
@Tiago thanks it helped 😃
28th Jul 2017, 4:34 AM
Vinayak Agrawal
Vinayak Agrawal - avatar
0
This code seems to be incomplete
28th Jul 2017, 4:16 AM
Tiago Soares
Tiago Soares - avatar
0
no it's not
28th Jul 2017, 4:17 AM
Vinayak Agrawal
Vinayak Agrawal - avatar