Home » C Programming » Structures » Question
  1. What will be the output of the following C code?
    #include <stdio.h>
    struct Company
    {
    int c1;
    char c2;
    };
    int main()
    {
    struct Company comp1[] = {10, 91, 30, 90, 52, 95};
    struct Company *ptr1 = comp1;
    int c1 = (sizeof(comp1) / 3);
    if (c1 == sizeof(int) + sizeof(char))
    printf("%d\n", ptr1->c1);
    else
    printf("Interview Mania");
    }
    1. Compilation Error
    2. Garbage value
    3. Interview Mania
    4. Nothing
    5. None of these
Correct Option: C

Interview Mania



Your comments will be displayed only after manual approval.