Answer to Question #236114 in C++ for SOM

Question #236114

Consider the code snippet given below:-

[Assume the necessary header files and namespaces included]

int x=10;

int main()

{   int x=20;

{ int x=30;

     }

       return 0;

}

Include the ‘cout’ statements at appropriate places in the program to get the output

 10 20 30


1
Expert's answer
2021-09-18T02:57:12-0400
#include<iostream>
using namespace std;
int x=10;


int main()


{ 
  cout<<x<<" ";
  int x=20;
  cout<< x<<" ";


{ int x=30;
  cout<<x;


     }


       return 0;


}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS