In this HackerRank Say "Hello, World!" with a C++ programming language problem you need to use either printf or cout to print the string to stdout.

HackerRank Say "Hello, World!" with C++ programming solution


HackerRank Say "Hello, World!" with a c++ problem solution.

#include <iostream>
#include <cstdio>
using namespace std;

int main() {
    printf("Hello, World!");
    return 0;
}


Second solution

#include <iostream>
using namespace std;

int main() {
    string greeting = "Hello, World!";
    cout << greeting << endl;
    
    return 0;
}