Point out the error (if any) in the following C code?
#include <stdio.h>
enum hello
{
a,b,c;
};
main()
{
enum hello m;
printf("%d",m);
}
Answer: B
Correct answer: Error in the statement: a,b,c;
The enumerator list must not end with a semicolon inside the braces - a, b, c is a comma-separated list, and the only semicolon belongs after the closing brace. Writing a,b,c; is a syntax error.
Please log in or register to report this question.