Computer Science, asked by samirafarooqui8, 1 year ago

What will be the output?
int k =5; j = 9;
k+ = k++ - ++j + k;
System.out.println("k = " +k); System.out.println("j="+j);

Answers

Answered by Khushi0105
406
The output is:-
k=k+k++ - ++j + k
k=5+5-10+6
k=16-10
k=6
so,output is:-
6
10
HOPE THIS ANSWER HELPS U..........Plzzz mark it as the brainliest.........
Answered by greeshmakachirayil
0

Answer:

The output is:-

6

10

Given:

k=k+k++ - ++j + k

k=5+5-10+6

k=16-10

k=6

The accessible variable's current value is instantly increased by the prefix increment operator before being utilized in an expression. In other words, while performing an increment operation, the value of a variable is first increased before being used inside of any expression.

b = ++a;

In this instance, one will be added to the current value of a before continuing. Then, for the expression in which it is used, b will be given the updated value.

The postfix increment operator lets you use a variable's current value in an expression and then raise it by one. To put it another way, a variable's value is first utilized inside the specified expression, and then it has its value is increased by 1.

For instance:

b = a++;

In this instance, b is first given the value of a, which is then increased.

Learn more about increment here:

https://brainly.in/question/6276676

Learn more about types of increment here:

https://brainly.in/question/21290992

#SPJ3

Similar questions