Home » C Programming » Structures » Question
  1. What will be the output of the following C code?
    #include <stdio.h>
    struct Option
    {
    int t1;
    int t2;
    };
    void fun(struct Option*);
    int main()
    {
    struct Option opt1[] = {12, 22, 23, 24, 25};
    fun(opt1);
    }
    void fun(struct Option opt[])
    {
    printf("%d %d\n", opt->t1, (opt + 2)->t2);
    }
    1. 12 0
    2. Compilation Error
    3. 12 garbage value
    4. Nothing
    5. undefined behaviour
Correct Option: A

12 0



Your comments will be displayed only after manual approval.