Determine Output: void main(){ struct xx { int x=3; char name[] = "hello"; }; struct xx *s = malloc(sizeof(struct xx)); printf("%d", s->x)…

Determine Output:

void main(){
    struct xx {
        int x=3;
        char name[] = "hello";
    };
    struct xx *s = malloc(sizeof(struct xx));
    printf("%d", s->x);
    printf("%s", s->name);
}
  1. a) 3 hello
  2. b) Compiler Error
  3. c) Linking error
  4. d) None of these

From the BB Assistant Programmer February 2023 – Written (BIBM) exam, question 15 of 37.

More from this paper