-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
  • 14,965
  • 21
  • 72
  • 139
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
  • 22,849
  • 3
  • 43
  • 87