Structures, Unions, Enums

Q1: What will be the output of the program in 16 bit platform (Turbo C under DOS) ?
#include<stdio.h>

int main()
{
    struct value
    {
        int bit1:1;
        int bit3:4;
        int bit4:4;
    }bit;
    printf('%d\n', sizeof(bit));
    return 0;
}

A 1

B 2

C 4

D 9

ANS:A - 1

Since C is a compiler dependent language, in Turbo C (DOS) the output will be 2, but in GCC (Linux) the output will be 4.



img not found
img

For help Students Orientation
Mcqs Questions

One stop destination for examination, preparation, recruitment, and more. Specially designed online test to solve all your preparation worries. Go wherever you want to and practice whenever you want, using the online test platform.