Answer to Question #217441 in C++ for kojo

Question #217441

Using the code stub below, 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.

#include <iostream>

using namespace std;

int main() {

  int num1;

  int num2;

  int finalResult;

  cin >> num1;

  cin >> num2;

  /* Your solution goes here */

  cout << "Final result: " << finalResult << endl;

  return 0;

}



1
Expert's answer
2021-07-15T00:13:11-0400
#include <iostream>


using namespace std;


int main() {


  int num1;


  int num2;


  int finalResult;


  cin >> num1;


  cin >> num2;


  finalResult = (num1 + num2) / 3;


  cout << "Final result: " << finalResult << endl;


  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