Home > C Programming > Quizzes > C Programming Practice Test: Floating Point & Sizeof Operator in C
C Programming Practice Test: Floating Point & Sizeof Operator in C
Fast practice, instant feedback. Timer auto-submits when time’s up.
Avg score: 90% Most missed: “In the following C code, the union size is decided by?”
Quiz on float datatype and sizeof keyword. Floating-point numbers Floating-point numbers are a type of data that can represent real numbers. They are stored in memory using a format that includes a sign bit, an exponent, and a significand. The size of a floating-point number depends on the specific implementation of the C programming language. However, it is typically 32 bits or 64 bits. Floating-point numbers can be used to represent a wide range of values, from very small numbers to very large numbers. However, they are not as precise as integers. Sizeof operator The sizeof operator... Show more
C Programming Practice Test: Floating Point & Sizeof Operator in C
Time left 00:00
25 Questions

1. Modulus for float could be achieved by?
2. Which of the following % operation is invalid?
3. Loss in precision occurs for typecasting from____________
4. In the following C code, the union size is decided by?
union temp
{
char a;
int b;
float c;
};
5. What will be the output of the following C code?
#include
(sizeof double = 8, float = 4, void = 1)
#define PI 3.14
int main()
{
printf("%d", sizeof(PI));
}
6. What will be the output of the following C code?
#include
printf("%.0f", 2.89);
7. Which among the following is never possible in C when members are different in a structure and union?
//Let P be a structure
//Let Q be a union
8. Select the odd one out with respect to type?
9. Which data type is suitable for storing a number like?
10.0000000001
10. What type of value does sizeof return?
11. Which among the following is never possible in C when members in a structure are the same as that in a union?
//Let P be a structure
//Let Q be a union
12. What will be the output of the following C code?
#include
main()
{
int a = 1;
printf("size of a is %d, ", sizeof(++a));
printf("value of a is %d", a);
};
13. In a 32-bit compiler, which 2 types have the same size?
14. Which among the following has the highest precedence?
15. What will be the output of the following C code?
#include
printf("%d", sizeof(strlen("HELLOWORLD")));
16. %lf is used to display?
17. What will be the size of the following C structure?
#include
struct temp
{
int a[10];
char p;
};
18. Which among the following is never possible as an output for a float?
19. Which among the following statement is right?
20. Size of an array can be evaluated by __________
(Assuming array declaration int a[10];)
21. Which of the following cannot be used inside sizeof?
22. Which of the following is not an operator in C?
23. What is the size of float in a 32-bit compiler?
24. How many digits are present after the decimal in float value?
25. What will be the output of the following C code?
#include
int main()
{
float a = 2.455555555555;
printf("%f", a);
}