#include<stdio.h>
const enum Alpha{
X,
Y=5,
Z=Y+1,
}p=10;
int main(){
enum
Alpha a,b;
a= X;
b= Z;
printf("%d",a+b-p);
return 0;
return 0;
}
Output: -4
Explanation: Default value of enum constant X is zero and
Z
= Y + 1 = 5 + 1 = 6
So,
a + b – p
=0
+ 6 -10 = -4
No comments:
Post a Comment