Home » C Programming » Pointers » Question
  1. What will be the output of the following C code?
    #include <stdio.h>
    struct clothes
    {
    int size;
    char Brand_name[24];
    };
    void main()
    {
    clothes c;
    c.size = 36;
    printf("Peter England");
    }
    1. Compilation Error
    2. Garbage value
    3. Peter England
    4. Nothing
    5. None of these
Correct Option: A

Compilation Error

main.c: In function ‘main’:
main.c:9:9: error: unknown type name ‘clothes’; use ‘struct’ keyword to refer to the type
clothes c;
^~~~~~~
struct
main.c:10:10: error: request for member ‘size’ in something not a structure or union
c.size = 36;



Your comments will be displayed only after manual approval.