C Programming Questions and Answers – Float Datatype – 1

«
»

This set of C Multiple Choice Questions & Answers (MCQs) focuses on “Float Datatype – 1”.

Pre-requisite for C Float Datatype MCQ set: Video Tutorial on C Data Types.

advertisement

1. How many digits are present after the decimal in float value?
a) 1
b) 3
c) 6
d) 16
View Answer

Answer: c
Explanation: None.

2. Which among the following is never possible as an output for a float?
a) 3.666666
b) 3.666
c) 3
d) None of the mentioned
View Answer

Answer: d
Explanation: None.
Note: Join free Sanfoundry classes at Telegram or Youtube
advertisement
advertisement

3. In a 32-bit compiler, which 2 types have the same size?
a) char and short
b) short and int
c) int and float
d) float and double
View Answer

Answer: c
Explanation: None.

4. What is the size of float in a 32-bit compiler?
a) 1
b) 2
c) 4
d) 8
View Answer

Answer: c
Explanation: None.
Take C Programming Practice Tests - Chapterwise!
Start the Test Now: Chapter 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
advertisement

5. Loss in precision occurs for typecasting from____________
a) char to short
b) float to double
c) long to float
d) float to int
View Answer

Answer: d
Explanation: None.

6. In the following C code, the union size is decided by?

advertisement
  1.     union temp
  2.     {
  3.         char a;
  4.         int b;
  5.         float c;
  6.     };

a) char
b) int
c) float
d) both int and float
View Answer

Answer: d
Explanation: None.
advertisement

7. %f access specifier is used for ________
a) Strings
b) Integral types
c) Floating type
d) All of the mentioned
View Answer

Answer: c
Explanation: None.

8. Select the odd one out with respect to type?
a) char
b) int
c) long
d) float
View Answer

Answer: d
Explanation: None.

Sanfoundry Global Education & Learning Series – C Programming Language.

To practice all areas of C language, here is complete set of 1000+ Multiple Choice Questions and Answers.

advertisement
advertisement

Leave a Comment

Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & technical discussions at Telegram SanfoundryClasses.