Finish implementing the code below, so that the main functioncalls both functions p() and prints the value of both variablesnamed x. include your code with comments explaining the changes youmade
namespace orange {
double x = 1;
void p() {
cout << “from orange” << endl; }
}
namespace blue {
double x = 2;
void p() {
cout << “from blue” << endl; } }
// main function
int main() {
// fix this code so that it prints x and
// calls P() from both namespaces
// cout << x << endl; // p(); return 0;
}
Expert Answer
An answer will be send to you shortly. . . . .