Challenge: Convert ipv4 Address to its Dotted Form

Let’s solve a coding challenge based on bit operations.

Problem statement

Write a function that returns an IPv4 address in its dotted form, given the hexadecimal number as input.

Sample input

0xc0a80102

Sample output

192.168.1.2

Challenge

This problem is designed for you to practice, so try to solve it on your own first. If you get stuck, you can always refer to the explanation and solution provided in the next lesson. Good luck!

Get hands-on with 1400+ tech skills courses.