fork download
  1. #include <stdio.h>
  2. #include <iostream>
  3. #include <string>
  4.  
  5. using namespace std;
  6.  
  7. int main(void) {
  8. unsigned short t1=0x8000;
  9. if(t1 & 0x8000) {
  10. // t1=t1 & 0x7FFF;
  11.  
  12. // znak=1;
  13. }
  14. t1=t1<<1;
  15. printf("Do = \%hx \n",t1);
  16. t1=(~t1);
  17. printf("Invert = \%hx \n",t1);
  18. t1=t1>>7;
  19. printf("Sdvig = \%hx \n",t1);
  20. short temp = (short)t1+1;
  21. printf("Result = \%hx \n",temp);
  22. temp=~temp;
  23. printf("invert = \%hx \n",temp);
  24. printf("Try programiz.pro");
  25.  
  26. return 0;
  27. }
  28.  
Success #stdin #stdout 0.01s 5276KB
stdin
Standard input is empty
stdout
Do = 0 
Invert = ffff 
Sdvig = 1ff 
Result = 200 
invert = fdff 
Try programiz.pro