Course Solutions Uncategorized (Solved) : Finish Implementing Code Main Function Calls Functions P Prints Value Variables Named X In Q33141464 . . . .

(Solved) : Finish Implementing Code Main Function Calls Functions P Prints Value Variables Named X In Q33141464 . . . .

 

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. . . . .

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post