Skip to content
Related Articles
Get the best out of our app
GeeksforGeeks App
Open App
geeksforgeeks
Browser
Continue

Related Articles

C Quiz – 102 | Question 3

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

Suppose a C program has floating constant 1.414, what’s the best way to convert this as “float” data type?

(A) (float)1.414
(B) float(1.414)
(C) 1.414f or 1.414F
(D) 1.414 itself of “float” data type i.e. nothing else required.


Answer: (C)

Explanation: By default floating constant is of double data type. By suffixing it with f or F, it can be converted to float data type. For more details, this post can be referred here.


Quiz of this Question

My Personal Notes arrow_drop_up
Last Updated : 28 Jun, 2021
Like Article
Save Article
Similar Reads