In this HackerRank Input and Output problem in c++, we need to develop a c++ program that can read 3 numbers from stdin and print their sum to stdout.

HackerRank Input and Output in c++ problem solution

 

HackerRank Input and Output in c++ problem solution

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


int main() {

    int sum = 0;
    int x, y, z;

    cin >> x >> y >> z;
    sum = x + y + z;
    cout << sum << endl;

    return 0;
}