I am trying to write a function in c++ to calculate the sum and product so my code is like that:
#include <iostream>
using namespace std;
int Product_Sum(int x, int y, int z)
{
int sum, product;
sum = x + y + z;
product = x * y * z;
return sum, product;
}
int main() {
int result;
int x = 5, y = 10, z = 15;
result = Product_Sum(x, y, z);
cout << result;
enter code here
}
as a result I am just getting the sum of the numbers, how I can return both values together ? I tried writing it with retrurning 0 but I think it's not the right way