it calculates ip in c