Q. What will be the output of the following C code considering the size of short int is 2, char is 1 and int is 4 bytes?

Code:
#include <stdio.h>
    int main()
    {
        short int k = 23;
        char ch = 99;
        printf("%d, %d, %d\n", sizeof(k), sizeof(ch), sizeof(ch + k));
        return 0;
    }
  • (A) 23
  • (B) 99
  • (C) 2, 1, 4
  • (D) 4, 1, 2
πŸ’¬ Discuss
βœ… Correct Answer: (C) 2, 1, 4

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
265
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Monu Rathod
Publisher
πŸ“ˆ
93%
Success Rate