aliensbrain
  • Home
  • Study
  • Quizzes
  • 🎤AI Practicefree
  • Notebooks
  • Community
  • Sign in
  • Programs in C
  • Const enum Beta{x, y=4, z}p=11; void main() { enum Beta a...
Multiple choice

Const enum Beta{x, y=4, z}p=11; void main() { enum Beta a, b; a=x; b=z; printf("%d", a+b-2p); }

  1. 10

  2. 15

    • 15
  3. Runtime error

  4. Syntax error

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Default value of enum constant x is zero. z=y+1= 4+1= 5. So a+b-2p= 0+5-2*10= -15.

Keep practicing — related questions

  • Output ??? enum {false,true}; int main() { int i=1; do { printf("%d\n",i); i++; if(i < 15) continue; }while...
  • void main() { int x; x=1; x= 2 + 2 * x++; printf("%d", x); }
  • main(){ int a,b; a=0; b=(a=1)?2:3; printf("%d %d",a,b); }
  • void main() { int i=3; int *j, **k; j=&i; k=&j; printf("%u%u%d", k, *k, **k);}
  • What will be the output for the following? enum color{pink,yellow,blue,black}; #include<iostream.h> void ma...
  • #include const int SIZE = 5; struct tester { int array[SIZE]; enum { SIZE = 3 }; void size() { std::cout <<...
  • Given: 12. public class Test { 13. public enum Dogs {collie, harrier}; 14. public static void main(String [...
  • What is the output of the following program? #include void main() { enum birds{parrot,crow,pigeon,sparrow};...
Play the full quiz 🎤 Practise this topic out loud
Advertisement
© Aliensbrain | all rights reserved
  • About
  • Contact
  • Terms and Condition
  • Privacy Policy