Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Correct Declaration of Values to variables ‘a’ and ‘b’?

a) int a = 32, b = 40.6;
b) int a = 42; b = 40;
c) int a = 32; int b = 40;
d) int a = b = 42;

Answer: c
Explanation: i) Although, declaration of ‘b’ and ‘a’ are correct but initialization of value to ‘b’ should be ‘int’ data type not float.
ii) Missing declaration type of ‘b’.
iii) correctly declared data types ‘a’ and ‘b’.
iv) ‘b’ can’t be assigned values before declaration.

Join The Discussion