in Programming in C
751 views
0 votes
0 votes
int main()

{

int a = 10;

cout<<a++;

return 0;

}

 

(A) 10

(B) 11

(C) 12

(D) Not defined
in Programming in C
751 views

4 Comments

Why 11 is not output by program
0
0

@Jeetmoni saikia  Before asking the questions at least you should know about what are the postfix and prefix increments.

2
2
U better explain it
–1
–1

1 Answer

2 votes
2 votes
Here as you can see

cout « a++ ;

a++ is postfix unary operation on a  which is interpreted as first value of “a” will be used then increment will be done

So printed value will be 10

but the value stored in a will be 11

2 Comments

So what will be the answer?
0
0
a only
0
0

Related questions