Home » C Programming » Structures » Question
  1. What will be the output of the following C code?
    #include <stdio.h>
    struct option
    {
    int n1;
    int n2;
    };
    int main()
    {
    struct option opt1[] = {101, 97, 32, 91, 52, 91};
    struct option *ptr1 = opt1;
    int n1 = (sizeof(opt1) / 5);
    if (n1 == 3)
    printf("%d %d\n", ptr1->n1, (ptr1 + n1 - 1)->n1);
    else
    printf("False\n");
    }
    1. Undefined behaviour
    2. Compilation Error
    3. Garbage value
    4. Nothing
    5. False
Correct Option: E

False



Your comments will be displayed only after manual approval.