Input and output C++ HackerRank solution
Consuming an input in a program and showing it as output is one of the crucial things to get started in introductory programming. This tutorial will show you the Input and output C++ HackerRank solution and make sure you get started the right way.
Problem statement
In this challenge, we practice reading input from stdin and printing output to stdout. In C++, you can read a single whitespace-separated token of input using…
You can check out the complete problem on Input and Output (opens in a new tab) at HackerRank.
Also Read: Hello world problem solved Hackerrank
Solution
By using a Cin, we can take multiple inputs respectively and assign them to each variable. With Cout, we can return each variable in the same way, though in this case, we are returning the sum on the inputs.
#include <iostream>
using namespace std;
int main() {
int a,b,c;
cin>>a>>b>>c;
cout<<a+b+c;
return 0;
}