Floating and Decimal Data Types Multiple Questions and Answers.




1.Select a convenient declaration and initialization of a floating point number ?
A. float somevariable = 12.502D
B. float somevariable = (Double) 12.502D
C. float somevariable = (float) 12.502D
D. float somevariable = (Decimal)12.502D

2.Number of digits up-to which precision value of float data type is valid ?
A. Up-to 6 digit
B. Up-to 7 digit
C. Up-to 8 digit
D. Up-to 9 digit

3.Valid Size of float data type is ?
A. 10 Bytes
B. 6 Bytes
C. 4 Bytes
D. 8 Bytes

4.Correct way to define a value 6.28 in a variable ‘pi’ where value cannot be modified ?
A. #define pi 6.28F
B. pi = 6.28F
C. const float pi = 6.28F
D. float pi = 6.28F

5. Minimum and Maximum range of values supported by ‘float’ data type are ?
A. 1.5 * 10-40 to 3.4 * 1038
B. 1.5 * 10-45 to 3.4 * 1030
C. 1.5 * 10-45 to 3.4 * 1038
D. 1.5 * 10-45 to 3.4 * 1037

»



Quick Links

GAT Subject



   Computer Science    English    Agriculture    Botany    

Engineering



   Computer Science    Civil Engineering    

Technical



   Networking    Electronics    Database    

Past Papers



   Model Papers    FPSC    PPSC    NTS