Warning: implode(): Invalid arguments passed in /www/wwwroot/jobquiz.info/mdiscuss.php on line 336 What will be the output of the program in 16-bit platform (Turbo C under DOS) ? #include<stdio.h> int main() { printf("%d, %d, %d", sizeof(3.0f), sizeof('3'), sizeof(3.0)); return 0; } ?->(Show Answer!)
1. What will be the output of the program in 16-bit platform (Turbo C under DOS) ? #include<stdio.h> int main() { printf("%d, %d, %d", sizeof(3.0f), sizeof('3'), sizeof(3.0)); return 0; }
Ask Your Doubts Here
Comments
By: guest on 01 Jun 2017 06.02 pm
Step 1: printf("%d, %d, %d", sizeof(3.0f), sizeof('3'), sizeof(3.0)); The sizeof function returns the size of the given expression. sizeof(3.0f) is a floating point constant. The size of float is 4 bytes sizeof('3') It converts '3' in to ASCII value.. The size of int is 2 bytes sizeof(3.0) is a double constant. The size of double is 8 bytes Hence the output of the program is 4,2,8 Note: The above program may produce different output in other platform due to the platform dependency of C compiler. In Turbo C, 4 2 8. But in GCC, the output will be 4 4 8.