fork download
  1. #include <netinet/in.h>
  2. #include <stdio.h>
  3.  
  4. int main() {
  5. uint32_t num = 402768424; // The number you got
  6. uint16_t port_nbo = num & 0xFFFF; // Convert to 16-bit
  7. uint16_t port_hbo = ntohs(port_nbo); // Convert to host byte order
  8.  
  9. printf("Port number: %d\n", port_hbo);
  10.  
  11. return 0;
  12. }
Success #stdin #stdout 0.01s 5304KB
stdin
Standard input is empty
stdout
Port number: 10434