COMPILER DESIGN

SEMANTIC ANALYSIS

ATTRIBUTE GRAMMARS

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
What value does the variable a have after ALL of the code above executes?int a;int b;a=1;b=a++;
A
1
B
2
C
3
D
None
Explanation: 

Detailed explanation-1: -A program can increment by 1 the value of a variable called c using the increment operator, ++, rather than the expression c=c+1 or c+=1. An increment or decrement operator that is prefixed to (placed before) a variable is referred to as the prefix increment or prefix decrement operator, respectively.

Detailed explanation-2: -JavaScript has an even more succinct syntax to increment a number by 1. The increment operator ( ++ ) increments its operand by 1; that is, it adds 1 to the existing value. There’s a corresponding decrement operator (–) that decrements a variable’s value by 1 .

There is 1 question to complete.