← Back to Namespaces
Question 184
Two Namespaces, Same Function Name
Two Namespaces, Same Function Name
Namespaces let two functions share a name without clashing. Define two namespaces: 1) English with a function stringgreeting()that returns "Hello". 2) Spanish with a function stringgreeting()that returns "Hola". The test will printEnglish::greeting()thenSpanish::greeting(). Do NOT write a main function.
Expected Output:
Hello Hola
= newline. The output ends with a newline — print one after the last line.
Hints4 available
Sign in to use hintsTopics:
Namespaces
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (cout, fori)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.