Answer to Question #136152 in C++ for alisha

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
1
Expert's answer
2020-10-01T14:49:52-0400
#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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS