how to Print the sum of the three numbers on a single line?
#include <iostream>
using namespace std;
int main()
{
int a= 1, b= 2, c=7;
a = a+b+c;
cout<<a;
return 0;
}
#include <iostream>
using namespace std;
int main()
{
int a= 1, b= 2, c=7;
a = a+b+c;
cout<<a;
return 0;
}
Hey there,
Hope you are doing well :)
#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;
}
Hope this answer helps! :)