Question: Write a program that asks for the IP address in a human readable form, creates three substrings, and prints them. These substrings are created from

Write a program that asks for the IP address in a human readable form, creates three substrings, and prints them. These substrings are created from parts 3, 2 and 1 of the last part of the IP address. These substrings should be created with the use of pointers OR array indexing. If a given string doesn't have 3 dots, then the program should print the message: "Error: not a valid address.". The program should also check if a given string consists only of digits and dots and that there are no more than 3 digits in each block.

Example output

Input : 255.255.255.255

Part 3: 255.255.255

Part 2: 255.255

Part 1: 255

Use

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!