96.5k views
1 vote
If variable x has value 2 and y has value 1, which values could result from the following Jack expression?

x + 3 * 4 - y

1 Answer

4 votes

Answer:

The result of the given expression is 13.

Step-by-step explanation:

Here x and y are the two variable which has value 2 and 1 respectively.

x+3*4-y

Here operator * is more precedence then that + operator so

=2+(3*4)-1

2+12-1 now + operator is more precedence then that - operator so

=(2+12)-1

=(14-1)

=13

Following are the program in C language

#include <stdio.h>// header file

int main() // main function

{

int x=2,y=1; // variable declaration

printf("%d",x+3*4-1); b// final result

return 0;

}

Output:13

User Falene
by
5.4k points