What will the value of the solution variable be after the code segment below has been run.
int solution = 90;
int number12 = 16, number25 = 8;
solution -= number12 * number25 ;
Answer is = -38
"number12 \\times number25 = 16 \\times 8 = 128\\\\\nsolution -= 128\\\\\n90 -= 128\\\\\n=90 - 128 = -38\\\\"
You can also use the following program:
#include<iostream>
using namespace std;
int main(){
int solution = 90;
int number12 = 16, number25 = 8;
solution -= number12 * number25 ;
cout<<solution<<endl;
}
Comments
Leave a comment