fork download
  1. #include <stdio.h>
  2.  
  3.  
  4. unsigned short
  5. PrDet2_combineBytesUint16(unsigned char byte1, unsigned char byte2)
  6. {
  7. unsigned short result = byte1;
  8.  
  9. result = (result << 8) | byte2;
  10. return result;
  11. }
  12.  
  13. int main(void) {
  14. // your code goes here
  15. unsigned char a = 0x30;
  16. unsigned char b = 0x02;
  17.  
  18. unsigned short c = PrDet2_combineBytesUint16(a, b);
  19.  
  20. printf("%x\n", c);
  21.  
  22. return 0;
  23. }
  24.  
Success #stdin #stdout 0s 5372KB
stdin
Standard input is empty
stdout
3002