45. Same-Named Variables

Back To All Submissions
Previous Submission
Next Submission
#include <iostream>
using namespace std;

namespace A{
// your code here: declare namespace A with int threshold=50
    int threshold=50;
}
namespace B{
// your code here: declare namespace B with int threshold=75
    int threshold=75;
}

int main() {
    cout << "A.threshold=" << A::threshold << "\n";
    cout << "B.threshold=" << B::threshold << "\n";
    return 0;
}
Was this helpful?
Upvote
Downvote