closed by
381 views
0 votes
0 votes
closed with the note: Undefined Behaviors in C
What is the output of the program?? I think the output should be 2 2 1 . But on running the program gives the output 2 3 3 . Pls explain why that output 2 3 3 in details .

#include<stdio.h>
int main()
{
    int a=1;
    printf("%d %d %d",a++,++a,a);
}
closed by

Related questions

0 votes
0 votes
1 answer
2
hacker16 asked Nov 17, 2017
1,112 views
What is the output generated by this code?main(){ int i=0; printf("%d %d %d %d %d %d %d", i++, ++i, i, i++, i, ++i, i++); }4 4 3 2 2 2 04 5 5 2 5 5 00 2 2 2 2 4 4Compiler...
0 votes
0 votes
1 answer
3
radha gogia asked Aug 10, 2015
392 views
CASE A: CASE A: &#8234;#&lrm;include&#8236;<stdio.h int divide( int a, b) { return 7; } int main() { int a=divide(8,3); printf("%d",a); return 0; }CASE B :CASE B : #inclu...
0 votes
0 votes
2 answers
4
bahirNaik asked Jan 13, 2016
642 views
After executing the program, I am getting 10 as the answer.Please explain and give the postfix for the expression [ z=x++-y*b/a ].