What will be the output of the following C function?



#include <stdio.h>


enum birds {SPARROW, PEACOCK, PARROT};


enum animals {TIGER = 8, LION, RABBIT, ZEBRA};


int main()


{


enum birds m = TIGER;


int k;


k = m;


printf("%d\n", k);


return 0;


}


a) 0

b) Compile time error

c) 1

d) 8



Answer: d

Explanation: m is an integer constant, hence it is compatible.



Posted on by