Top

Discussion

Can we have enum containing enum with same contestant?

#include "stdio.h"

enum Yenum{
       C, CPP, Java
};

enum Xenum{
    C, CPP, Java, Yenum
};

int main()
{
  enum Xenum var;
  printf("%d",sizeof(var));
  return 0;
}

 

  • A.Enum can contain enum but duplicate contestants are not allowed
  • B.Enum can't contain enum
  • C.Enum can contain enum but not accessible
  • D.This code will produce compilation error

Answer: A

No answer description available for this question

No comment is present. Be the first to comment.
Loading…

Post your comment