Answer:
a. 118.20.210.254
Explanation:
Here are the few characteristics of Class A:
First bit of the first octet of class A is 0.
This class has 8 bits for network and 24 bits for hosts.
The default sub-net mask for class A IP address is 255.0.0.0
Lets see if the first bit of first octet of 118.20.210.254 address is 0.
118 in binary (8 bits) can be represented as : 1110110
To complete 8 bits add a 0 to the left.
01110110
First bit of the first octet of class A is 0 So this is class A address.
For option b the first octet is : 183 in the form of bits = 10110111 So it is not class A address
For option c the first octet is 215 in the form of bits = 11010111 So it is not class A address
For option d the first octet is 255 in the form of bits = 11111111. The first bit of first octet is not 0 so it is also not class A address.
Answer:
if (x > 7 && Math.sqrt(x) < 3)
Explanation:
The previous condition checks if the square root of x is less than 3, but this would raise an error if x is a value equal to or less than 0.
So, the condition checks for the value of x before evaluating the square root after the AND operation to prevent an arithmetic exception.