Question #136152

Write a statement that assigns finalResult with the sum of num1 and num2, divided by 3. Ex: If num1 is 4 and num2 is 5, finalResult is 3

Expert's answer

#include <iostream>
using namespace std;

int main()
{
    int num1, num2, sum;
    
    cout << "Enter two integers: ";
    cin >> num1 >> num2;

    // Sum of two numbers which will be divide by 3 will be stored//sum
    sum = (num1 + num2)/3;

    // Result display
    cout << "The required sum result:" << sum;     

    return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS