Question: Q 4 ) Accept a string from the user. The string is an IPV 4 address. Write a program to validate the address. [ 2

Q4) Accept a string from the user. The string is an IPV4 address. Write a program to validate the address.
[2]
Rules according to
Wikipedia.org
IPv4 uses 32-bit addresses in dot-decimal notation, which consists of four decimal numbers, each ranging from 0 to 255, separated by dots.
Example 1:
Input:
192.0.2.265
Output:
Invalid IPV4
Example 2:
Input:
192.0.2.21
Output:
Valid IPV4
Input:
192.3.45.6.5
Output:
Invalid IPv4
 Q4) Accept a string from the user. The string is an

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!