0

Program 1

#include <stdio.h>

int main()
{
   int a = 10, m;

   m = a++ + ++a - a++;

   printf("%d %d", m, a);
}

Program 2

#include <stdio.h>

int main()
{
   int a = 10;

   printf("value of m=%d", a++ + ++a - a++);
}
John Bollinger
  • 160,171
  • 8
  • 81
  • 157
Abhay
  • 1
  • 1
  • 3
    It doesn't work, the behavior is undefined. – interjay Jul 31 '22 at 14:24
  • To be clear, it is the behavior of evaluating the expression `a++ + ++a - a++` that is undefined. This has nothing in particular to do with the question given in the title, but we are assuming that you ask because you have observed manifestations of the undefinedness. – John Bollinger Jul 31 '22 at 14:26

0 Answers0