What will the value of the result variable be after the code segment below has been run.
int number1 = 93;
int answer = 128;
if( number1 > 49 )
{
answer -= number1 ;
}
else
{
answer += number1 ;
}
#include<iostream>
using namespace std;
int main()
{
int number1 = 93;
int answer = 128;
if (number1 > 49)
{
answer -= number1;
}
else
{
answer += number1;
}
cout << "The value of the result variable is " << answer;
}
Comments
Leave a comment