Q. What is the output of C program with strings?

Code:
int main()
{
    char var='b';
    printf("%d ", sizeof("a"));
    printf("%d ", sizeof('b'));
    printf("%d ", sizeof(10));
    printf("%d ", sizeof(var));
}
//int size is 2 bytes
  • (A) 2 2 2 2
  • (B) 2 2 2 1
  • (C) 2 1 2 1
  • (D) 1 1 1 1
πŸ’¬ Discuss
βœ… Correct Answer: (B) 2 2 2 1

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
245
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Ram Sharma
Publisher
πŸ“ˆ
88%
Success Rate