Question 7809 – Operating-Systems
March 6, 2024Question 10300 – Database-Management-System
March 6, 2024Question 4074 – UGC NET CS 2005 Dec-Paper-2
What is the output of the following C-program
main()
{
printf(”%d%d%d”, sizeof(3.14f), sizeof(3.14), sizeof(3.141));
}
Correct Answer: E
Question 11 Explanation:
The sizeof operator will print number of bytes of a data type.
sizeof(3.14f) → It will consider as float data type. The float data type size is 4 bytes.
sizeof(3.14) → It will consider as double data type. The double data type size is 8 bytes.
sizeof(3.141) → It will consider as double data type. The double data type size is 8 bytes.
Output= 4 8 8
Note: The exact size of each of these 3 types depends on the C compiler implementation (or) platform
sizeof(3.14f) → It will consider as float data type. The float data type size is 4 bytes.
sizeof(3.14) → It will consider as double data type. The double data type size is 8 bytes.
sizeof(3.141) → It will consider as double data type. The double data type size is 8 bytes.
Output= 4 8 8
Note: The exact size of each of these 3 types depends on the C compiler implementation (or) platform
4 4 4
4 8 10
8 4 8
8 8 8
None of the above
Subscribe
Login
0 Comments