Q. What will be the output of the following C function?

Code:
#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
πŸ’¬ Discuss
βœ… Correct Answer: (D) 8

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
230
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Geetam
Publisher
πŸ“ˆ
81%
Success Rate