fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. // your code goes here
  5. int position1=0, position2=0, position3=0, position4=0;
  6. unsigned short CurrCount, PrevCount;
  7. CurrCount=0x0000;
  8. PrevCount=0xFFFF;
  9. position1=(CurrCount-PrevCount)+position1;
  10. position2=((int)CurrCount-(int)PrevCount)+position2;
  11. position3=(int)(CurrCount-PrevCount)+position3;
  12. position4=(short)(CurrCount-PrevCount)+position4;
  13. printf("p1= %x, p2= %x, p3=%x, p4=%x", position1, position2, position3, position4);
  14.  
  15. return 0;
  16. }
  17.  
Success #stdin #stdout 0.01s 5280KB
stdin
Standard input is empty
stdout
p1= ffff0001, p2= ffff0001, p3=ffff0001, p4=1