Challenge: Convert Four Octet Values to the Corresponding 32-bit

Here is a coding challenge based on the concepts covered in this chapter.

Problem statement

Write a function that converts the 4 octet values in an IPv4 address to the corresponding 32-bit decimal value.

Sample input

ipAddress(192, 168, 1, 2)

Sample output

3232235778

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 1000+ tech skills courses.