Nested Namespace Declaration

#include <iostream>
using namespace std;
#define el cout<<"\n"
namespace Config {
    namespace ADC { int resolution = 12; }
    namespace PWM { int frequency = 1000; }
}

int main() {
    cout <<"ADC.resolution="<<Config::ADC::resolution;
    el;
    cout <<"PWM.frequency="<<Config::PWM::frequency;
    // your code here: print resolution and frequency with their namespace paths
    return 0;
}

Solving Approach

 

 

 

 

Upvote
Downvote
Loading...

Input

Expected Output

ADC.resolution=12 PWM.frequency=1000