Professional Documents
Culture Documents
Sample Question2 Array
Sample Question2 Array
An IP address is defined as a numerical address separated by a full stop and which is used to define
a particular device on the network. Generally, size of the IP address is 4 bytes. It is represented in
the form of dotted decimal notation, where each byte of the IP is separated by a period(.) and value
of each byte is in the range of 0 to 255(both inclusive).
Syntax of writing an IP: (1st byte . 2nd byte . 3rd byte . 4th byte) and each byte is in the range of 0 to
255.
Now, each of such IP Addresses can be divided into 5 classes, named A,B,C,D and E. The
conditions for each of the classes is as follows:
A company has n IP addresses, each of which is represented by an array of size 4, where each
element represents one byte of the address.
So for each of the n IP addresses, write a C program that determines the class of the n IP addresses.