16-bit Sum Product

#include <iostream>
#include <cstdint>
using namespace std;

// Write your code here
void compute(int16_t a, int16_t b, int32_t& sum, int32_t& product) {
    // Write your code here
    sum = a + b;
    product = a * b;
}

int main() {
    int16_t a, b;
    cin >> a >> b;

    int32_t sum = 0, product = 0;

    compute(a, b, sum, product);

    cout << sum << " " << product;

    return 0;
}
Upvote
Downvote
Loading...

Input

3 4

Expected Output

7 12