#include <iostream>
int main()
{//---------------------------->scope1 started here
//------v---------------------->this variable x is in scope1
int x=5;
{//------------------------>scope2 started here
//----------v------------------>this variable x is in scope2
int x= 6;
//------------v---------------->this prints scope2's x value
std::cout<<x;
}//------------------------>scope2 ends here and x from scope2 is destroyed
//--------v---------------->this prints scope1's x value
std::cout<<x;
}//---------------->scope1 ends here