Computer Science, asked by gowdavishruth5, 4 months ago

what will be the value of x and z after execution? x= 5; z =x++;​

Answers

Answered by Anonymous
0

Answer:

will be the value of x and z after

Answered by aditijaink283
0

Answer:

The answer to the given question is:

After execution value of

x=5

z=6

Explanation:

The increment (++) operator (-) is an important unary operator. Unary operators are operators that operate on a single operand. The increment operator increments the value of the variable by one, and ++ adds 1 to its operand.

There are significant differences between the prefix and postfix formats when increments or decrements are used as part of an expression. If you use the prefix format, the increment or decrement is performed before the rest of the expression, and if you use the postfix format, the increment or decrement is performed after the entire expression is evaluated.

Works in the same way as:

x = x + 1;

is the same as

x ++.

#SPJ2

Similar questions