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
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.........
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