C Programming - Float Datatype
Question 1
|
The number of digits present after decimal in float is________.
1
| |
3
| |
6
| |
16
|
Question 2
|
Which among the following is never possible as an output for float?
3.666666
| |
3.666
| |
3
| |
None of the mentioned
|
Question 3
|
In a 32-bit compiler, which 2 types have same size?
char and short
| |
short and int
| |
int and float
| |
float and double
|
Question 4
|
What is the size of float in a 32-bit compiler?
1
| |
2
| |
4
| |
8
|
Question 5
|
Loss in precision occurs for typecasting from____________.
char to short
| |
float to double
| |
long to float
| |
float to int
|
Question 6
|
For union
char
| |
int
| |
float
| |
Both (b) and (c)
|
Question 7
|
%f access specifier is used for
Strings
| |
Integral types
| |
Floating type
| |
All of the mentioned
|
Question 8
|
Select the odd one out with respect to type?
char
| |
int
| |
long
| |
float
|
Question 9
|
What is the output of this C code?
2.890000
| |
2.89
| |
2
| |
3
|
Question 10
|
What is the output of this C code?
2.455555
| |
2.455556
| |
2.456
| |
2.46
|
Question 11
|
Which of the following % operation is invalid?
2 % 4;
| |
2 % 4l;
| |
2 % 4f;
| |
Both (b) and (c)
|
Question 12
|
Which data type is suitable for storing a number like? 10.0000000001
int
| |
float
| |
double
| |
Both (b) and (c)
|
Question 13
|
Modulus for float could be achieved by?
a % b
| |
modulus(a, b);
| |
fmod(a, b);
| |
mod(a, b);
|
Question 14
|
Predict the data type of the following mathematical operation? 2 * 9 + 3 / 2 . 0
int
| |
long
| |
float
| |
double
|
Question 15
|
%lf is used to display
float
| |
long float
| |
double
| |
All of the mentioned
|
Check Your Answers:
1. C
2. D
3. C
4. C
5. D
6. D
7. C
8. D
9. D
10. A
11. C
12. C
13. C
14. D
15. C
0 comments:
Post a Comment