Home » C Programming » Structures » Question
  1. Comment on the output of the following C code.
    #include <stdio.h>
    struct Number
    {
    int n1;
    int n2;
    int n3;
    };
    main()
    {
    struct Number num[] = {{12, 22, 32}, {24, 25, 26}, {27, 28, 29}};
    }
    1. No Compile time error, generates an array of structure of size 9
    2. Compile time error, illegal declaration of a multidimensional array
    3. Compile time error, illegal assignment to members of structure
    4. No Compile time error, generates an array of structure of size 3
    5. None of these
Correct Option: D

No Compile time error, generates an array of structure of size 3



Your comments will be displayed only after manual approval.