Home » C Programming » Structures » Question
  1. What will be the output of the following C code?
     #include <stdio.h>
    struct output
    {
    int n1;
    char n2;
    };
    int main(){
    struct output out[] = {100, 90, 13, 95, 55, 92};
    struct output *ptr1 = out;
    int n1 = (sizeof(out) / sizeof(struct output));
    printf("%d %d\n", ptr1->n1, (ptr1 + n1 - 1)->n1);
    }
    1. 100 90
    2. 13 95
    3. 55 92
    4. 100 55
    5. None of these
Correct Option: D

100 55



Your comments will be displayed only after manual approval.