Computer Science, asked by pnaik090, 11 months ago

Evaluate the expression a+=b*=c-=5,where a=3,b=5,c=8

Answers

Answered by khairnarsanskriti
4

a+b*c-5

= 3+5x 8 -5

= 3+40-5

= 40-2=38

Answered by ridhimakh1219
19

Evaluate the expression a+=b*=c-=5,where a=3,b=5,c=8

Explanation:

C Program to evaluate simple expression

#include <stdio.h>

int main()

{

   int a = 3;

   int b = 5;

   int c = 8;

   printf("result of the expression = %d", (a+=b*=c-=5));

   return 0;

}

Output of the program

result of the expression = 18  

Note

Expression (a+=b*=c-=5)) is evaluated as follow:

(a+=b*=c-=5) where a = 3, b = 5 and c= 8

First, c-=5 is evaluated as c = c - 5 = 8 - 5 = 3

Second, b*=c is evaluated as b = b * c = 5 * 3 = 15

Third, a+=b is evaluated as a = a + b = 3 + 15 = 18

Similar questions