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

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 = 39;
^



Your comments will be displayed only after manual approval.