Resolve UART Namespaces

#include <iostream>
using namespace std;

// Create namespace Boot with nested namespace UART
namespace Boot {
    namespace UART {
        void send() {
            cout << "BOOT UART";
        }
    }
}

// Create namespace App  with nested namespace UART
namespace App {
    namespace UART {
        void send() {
            cout << "APP UART";
        }
    }
}

int main() {
    int mode;
    cin >> mode;

    // Call correct send() function here
    (mode == 1) ? Boot::UART::send() : App::UART::send();

    return 0;
}
Upvote
Downvote
Loading...

Input

1

Expected Output

BOOT UART