C++ | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
0

C++

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; } https://sololearn.com/discuss/2834075/?ref=app

14th Jul 2021, 12:40 AM
Solomon Fiaku
5 Respuestas
+ 1
I can just assign any variables to num1 and num2 and work with it right?
14th Jul 2021, 8:14 AM
Solomon Fiaku
+ 1
Ok thank you
14th Jul 2021, 9:06 PM
Solomon Fiaku
0
#include <iostream> using namespace std; int main() { int num1; int num2; int finalResult; cin >> num1; cin >> num2; /* Your solution goes here */ finalResult=(num1+num2)/3; cout << "Final result: " << finalResult << endl; return 0; }
14th Jul 2021, 2:33 AM
Abhishek Kumar
Abhishek Kumar - avatar
0
Bit if you check the question i poestec they say if num1 is 4 and num2 is 5
14th Jul 2021, 11:06 AM
Solomon Fiaku
0
Martin Taylor so is it okay to add num1 =4; num2 = 5;
14th Jul 2021, 6:07 PM
Solomon Fiaku