Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22157

C program confusing output for increment operation [duplicate]

$
0
0

I have simple C program which uses increment operator:

   int main() {       int a = 6;       a+= ++a +++a;       printf("value of a is %d\n", a);   }

As per my calculation output should be 23 but when I run it, output comesout to be 24.

Why out put comes out as 24 ?


Viewing all articles
Browse latest Browse all 22157

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>