Curioustab
Aptitude
General Knowledge
Verbal Reasoning
Computer Science
Interview
Aptitude
General Knowledge
Verbal Reasoning
Computer Science
Interview
Home
»
C Programming
»
Floating Point Issues
What will you do to treat the constant 3.14 as a float?
use float(3.14f)
use 3.14f
use f(3.14)
use (f)(3.14)
Show Answer
Correct Answer:
use 3.14f
Explanation:
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
)
← Previous
Next →
Discussion & Comments
No comments yet. Be the first to comment!
Name:
Comment:
Post Comment