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() {
    int n=MathOps::x;
    cout<<"x="<<n<<endl;
    cout<<"Square="<<MathOps::square(n);
    return 0;
}
Loading...

Input

Expected Output

x=10 Square=100