All submissions

Namespace with Variables and Functions

#include <iostream>
using namespace std;

namespace MathOps {
    int x = 10;
    int square(int n) {
        return n * n;
    }
}

int main() {
    // your code here: print MathOps::x
    // your code here: call MathOps::square(x) and print result
    cout <<  "x="<<MathOps::x << endl;

    // Call square(x) and print the result
    cout << "Square="<<MathOps::square(MathOps::x) << endl;
    return 0;
}
Loading...

Input

Expected Output

x=10 Square=100