-3
#include <stdio.h>

int main()
{
    int i = 6;
    printf("%d %d", ++i, i++);//printing
    return 0;
}

What will be output of the following code and why?

nalzok
  • 13,395
  • 18
  • 64
  • 118
imu007
  • 5
  • 1

1 Answers1

0
printf("%d %d",++i ,i++);//printing

Is undefined behavior. The order of argument processing is not specifically defined in the C standard, it is not possible to predict exactly what the output will be. It could be anything at all according to this.

ryyker
  • 21,724
  • 3
  • 41
  • 81