What will be the output of the following C code?
#include
enum sanfoundry
{
a=1,b,c,d,e
};
int main()
{
printf("%d",b*c+e-d);
}
Answer: B
Since arithmetic operations are allowed on enum constants, hence the expression given is evaluates. b*c+e-d = 2*3+5-4 = 6+5-4 = 7