0

I have written a simple code that is supposed to give me the sum of some integers. The code gives me the amount of 15 for integer a but when I calculate the amount of a myself it is supposed to be 14. Can you please tell me what I'm doing wrong?

#include <stdio.h>
#include <math.h>

    main()
     {
     int i=5, j=3, a=0;
     ++i;
     j++;
     a=++i+(i++)-(--j)+(j--);
     printf("%d%d%d",i,j,a);
}
Barmar
  • 669,327
  • 51
  • 454
  • 560
Yalda
  • 1

0 Answers0