Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

printing unexpected output

$
0
0
i am just learning about a++, ++a, a=a+1 .....so i write a code to understand it.
but it is printing unexpected output.

i think output should be 1 2 2 but i am getting 3 3 1.

what does it mean ?

#include<stdio.h>
#include<conio.h>
main()
{
      int i=1;
      printf("%d %d %d",i,++i,i++);
      getch();
      }



output : 3 3 1

Viewing all articles
Browse latest Browse all 51036

Trending Articles