9511_workbook

solved exercises from algorithms & programming I (9511) prof. Cardozo
Index Commits Files Refs README
guia07/ex06.c (246B)
   1 #include <stdio.h>
   2 
   3 int main (void)
   4 {
   5     unsigned int n;
   6     size_t i;
   7 
   8     unsigned char x[4] = {0x10, 0x30, 0x25,0xF4};
   9 
  10     for(i = 0, n = 0; i < sizeof(x); i++) {
  11         printf("%X", x[i]);
  12         n = ((n << 8) | x[i]);
  13     }        
  14 
  15     printf("\n%lu\n", n);
  16 
  17     return 0;
  18 }