Question: What will be output when you will execute following c code?#include<stdio.h>
const enum Alpha{
X,
Y=5,
Z
}p=10;
int main(){
enum Alpha a,b;
a= X;
b= Z;
printf("%d",a+b-p);
return 0;
}
A
B
C
D
E
-4
B
-5
C
10
D
11
E
Error: Cannot modify constant object
Note: Default value of enum constant X is zero and
Z = Y + 1 = 5 + 1 = 6
So, a + b – p
=0 + 6 -10 = -4