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

Như Quỳnh

New member
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.
 

Tìm kiếm

Back
Top