Floating Point Issues

Q1:
What will you do to treat the constant 3.14 as a float?

A use float(3.14f)

B use 3.14f

C use f(3.14)

D use (f)(3.14)

ANS:B - use 3.14f

Given 3.14 is a double constant.
To specify 3.14 as float, we have to add f to the 3.14. (i.e 3.14f)



img not found
img

For help Students Orientation
Mcqs Questions

One stop destination for examination, preparation, recruitment, and more. Specially designed online test to solve all your preparation worries. Go wherever you want to and practice whenever you want, using the online test platform.