adplus-dvertising
frame-decoration

Question

What will be output of the 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.

-4

b.

-5

c.

10

d.

11

Answer: (a).-4

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What will be output of the following c code?