Single Choice Not Set

QWhat will be output when you will execute following c code on a 32-bit machine?

#include<stdio.h>
int main(){
    int b=sizeof(const)+sizeof(volatile);
    printf("%d",b);
    return 0;
}

ID: #898 Data Types in C Language 3,028 views
Question Info
#898Q ID
Not SetDifficulty
Data Types in C LanguageTopic

Choose the Best Option

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

  • A 8
  • B 4
  • C 16
  • D 32
Correct Answer

Explanation

Output:

4

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

signed=2

unsigned=2

Then, 2+2=4

Share This Question

Challenge a friend or share with your study group.