3/14/2016

HackerRank Solution for Say "Hello, World!" With C++

Problem:- Hacker Rank Solution Program In C++ For " Say "Hello, World!" With C++ " or Hacker Rank Solution Program In C++ For Say "Hello, World!" With C++ or Say "Hello, World!" With C++ solution hacker rank or Hacker rank solution for c++ domain or Hacker rank solution for Say "Hello, World!" With C++ subdomain or Say "Hello, World!" With a C++ solution in c++ of hacker rank or introduction solutions hacker rank.

Check Here:- Geeksforgeeks solution for SchoolBasic, Easy, Medium, Hard in C++.

Explanation:- This is the first problem in C++ domain and under Introduction sub-domain. Just print the message ' Hello World! " in the console. In C++ for printing any message or printing the output in the console string, we always use a " cout " and "<< " operator after that double quotes and between the double quotes put the message whatever in this case we will put " Hello world! "

Example:-

cout<<"Hello, World!";

As we know that C++ is an extended version of C language, C++ support all the functionality of C language so we also can use " printf() " function instead of " cout<< ", but here our solution is in C++ so " cout<< " is better but we can use " printf() " as well.

Example:-

printf("Hello, World!");


Submit Your Solution Here:- Click Here


Solution:-

#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;

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

Output:-


Hacker Rank solution for Say "Hello, World!" With C++


Hacker Rank solution for Hello World!

No comments:

Post a Comment