+ 3

# Variables

Please can someone explain increments to me very well.. For example Var a=0, b=10; Var a=b++ Output a=10, b=11 Please how does that give that?

6 Answers

- 2

What is answer

+ 5

var a=0
var b=10
var a=b++// it shows that the value b++ is assign to a
b++ is post increment so first value is assign then it will incremented so
a=10 // because b++ value is still 10 due to post increment
and now the value of b incremented by 1 so
b=11
so finally the output is
a=10 b=11

+ 2

Var a = 0;
Var b = 10;
a = b++
at first
a = b = 10
++ means +1, so
10+1=11
a=11, b=10

+ 1

first of all we have variables a =0 and b=10. and in second line we are assigning the value of b to a and use ++ ie increment operator so that at last we have output a=10, b =11

0

Answer is a=10, b=11

0

How do i programme input using console.log in java.

Hot today

Bug: Sololearn notification is still showing number in the notification icon even i did mark as read

6 Votes

Web development

2 Votes

Finished python for beginners

1 Votes

Izzy the iguana code coach

0 Votes

C++ Question re stringstream

0 Votes

Why sometimes 0 is printed?

0 Votes