Evaluate each of the following expressions and list the final value of variable x.
1) x = 4-(8%5)*3/(8-6)%3;
2) x = ((9%8)*2)*8/5%(7/3)
3)x= (5-2*9+(3+((9/4)%2*3+6/(8%3))))
4)x =3/6+13%3+2
Expression 1:Â
step 1 = 4-3*3/(8-6)%3;
step 2 = 4-3*3/2 %3
step 3 = 4-9 / 2 %3
step 4 = 4-4 %3
step 5 = 4 - 1
Answer = 3
final value of x = 3
Expression 2:
step 1 = (1*2)*8/5%(7/3)
step 2 = 2 *8/5%(7/3)Â
step 3 = 2 *8/ 5%2
step 4 =Â 16 / 5%2
step 5 = 3 %2
Answer = 1
final value of x = 1
Expression 3:
step 1 = (5-2*9+(3+((9/4)%2*3+6/5)))
step 2 = (5-2*9+(3+( 2%2 *3+6/5)))
step 3 = (5-2*9+(3+( 2%6+6/5)))
step 4 = (5-2*9+(3+( 2 +6/5)))
step 5 = (5-2*9+(3+( 2 +1)))
step 6 = (5-18+(3+( 2 +1)))
step 7 = (5-18+(6))
step 8 = 11 - 18
answer = -7
final value of x = -7
Expression 4:
step 1 = 0 +13%3 + 2Â
step 2 = 0 + 1 + 2
step 3 = 1 + 2
answer = 3
final value of x = 3
Comments
Leave a comment