/* a sample program that prints the name of host. */
#include <stdlib.h>
#include <stdio.h>
#include <sys/socket.h>
#include <netdb.h>
#include <netinet/in.h>

int main() {
    unsigned long netnumber,localaddress;
    struct in_addr in;
    char cp[]="169.237.108.47";
    
    in.s_addr = inet_addr(cp); /* interpret character strings representing
                                numbers exapressed in the Internet stadard
                                'dot' notation. */
    netnumber = inet_netof(in); /* break apart Internet host address,
                                 returning the network numberpart. */
    localaddress = inet_lnaof(in); /* Break apart Internet host addresses, 
                                 returning the local network address part.*/
    in = inet_makeaddr(netnumber,localaddress); /* Take an Internet network 
                            number and a local network address and construct 
                            an Internet  address from it. */
    printf("%s\n",inet_ntoa(in));
}
