Skip to main content

C++ Hello World

Problem​

Let's begin your journey towards coding with the very first question of the coding world. Your task is to write code that prints Hello World.

Examples:​

Example 1:

Input:
No Input
Output:
Hello World

Your task:​

In the function helloWorld(), output a line "Hello World" (without quotes).

  • Expected Time Complexity: O(1)O(1)
  • Expected Auxiliary Space: O(1)O(1)

Solution​

C++​

void helloWorld() {
cout<<"Hello World"<<endl;
}
  • Time Complexity: O(1)O(1)
  • Auxiliary Space: O(1)O(1)