Menu
Topics Index
...
`

Session 14 has these questions


Odd Man Out

Identify the odd man in the below list?
A. 678.98
B. 6.7898e2
C. 6789800e-4
D. 0.00067898e7



Identify the correct statement about doubles

Identify the correct statement?
  • 1. double d1 = 200.0;
  • 2. double d2 = 2E+2;
  • 3. double d3 = 0.02E4;
  • 4. double d4 = 20000e-2;
A. All the above expressions are correct and have the same value 200.0.
B.  Expressions 2, 3, 4 lead to compilation errors.
C. Expression 3 leads to compilation errors.
D. Expression 4 leads to compilation errors.



Order the floating point literals

Arrange the following floating point literals from smallest to largest.
  • move 4.56E-4
  • move 45600e-7
  • move 4.56E3
  • move 45600
  • move 456



Character Literals

Which of the following is correct initialization?
A. Char a = 'A';
B. char c = 'a';
C. Character c = 'd';
D. char char = 9;



Declaractions1129

Which is valid declaration of a float?
A. float f = 1F;
B. float f = 1.0d;
C. float f = "1";
D. float f = 1.0;
E. None of the above



© meritcampus 2019

All Rights Reserved.

Open In App