Warning: implode(): Invalid arguments passed in /www/wwwroot/jobquiz.info/mdiscuss.php on line 336 If char=1, int=4, and float=4 bytes size, What will be the output of the program ? #include<stdio.h> int main() { char ch = 'A'; printf("%d, %d, %d", sizeof(ch), sizeof('A'), sizeof(3.14f)); return 0; } ?->(Show Answer!)
1. If char=1, int=4, and float=4 bytes size, What will be the output of the program ? #include<stdio.h> int main() { char ch = 'A'; printf("%d, %d, %d", sizeof(ch), sizeof('A'), sizeof(3.14f)); return 0; }
Ask Your Doubts Here
Comments
By: guest on 01 Jun 2017 06.02 pm
Step 1: char ch = 'A'; The variable ch is declared as an character type and initialized with value 'A'. Step 2: printf("%d, %d, %d", sizeof(ch), sizeof('A'), sizeof(3.14)); The sizeof function returns the size of the given expression. sizeof(ch) becomes sizeof(char). The size of char is 1 byte. sizeof('A') becomes sizeof(65). The size of int is 4 bytes (as mentioned in the question). sizeof(3.14f). The size of float is 4 bytes. Hence the output of the program is 1, 4, 4