MCQ Single Best Answer Not Set

QWhat will be output when you will execute following c code on a 64-bit machine?
 
#include<stdio.h>
int main(){
    int a= sizeof(signed) +sizeof(unsigned);
   printf("%d",a);
    return 0;
}

ID: #897 Data Types in C Language 2,343 views
Question Info
#897Q ID
Not SetDifficulty
Data Types in C LanguageTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A 10
  • B 9
  • C 8
  • D Cannot find size of modifiers
Correct Answer: Option C

Explanation

Output:

8

Default data type of signed, unsigned is int. In 64-bit machine size of int is 4 byte.

signed=4

unsigned=4

Then, 4+4=8

Share This Question

Challenge a friend or share with your study group.