enum colors {BLACK,BLUE,GREEN}

main()

{

printf("%d..%d..%d",BLACK,BLUE,GREEN);

return(1);

}




Answers were Sorted based on User's Feedback



enum colors {BLACK,BLUE,GREEN} main() { printf("%d..%d..%d",B..

Answer / susie

Answer :

0..1..2

Explanation:

enum assigns numbers starting from 0, if not
explicitly defined.

Is This Answer Correct ?    5 Yes 0 No

enum colors {BLACK,BLUE,GREEN} main() { printf("%d..%d..%d",B..

Answer / ana

0,1,2

Is This Answer Correct ?    1 Yes 0 No

Post New Answer




More C Code Interview Questions

#include<stdio.h> int main() { int x=2,y; y=++x*x++*++x; printf("%d",y); } Output for this program is 64. can you explain how this output is come??

1 Answers  


Which one is taking more time and why ? :/home/amaresh/Testing# cat time.c //#include <stdio.h> #define EOF -1 int main() { register int c; while ((c = getchar()) != EOF) { putchar(c); } return 0; } ------------------- WIth stdio.h:- :/home/amaresh/Testing# time ./time_header hi hi hru? hru? real 0 m4.202s user 0 m0.000s sys 0 m0.004s ------------------ Witout stdio.h and with #define EOF -1 =================== /home/amaresh/Testing# time ./time_EOF hi hi hru? hru? real 0 m4.805s user 0 m0.004s sys 0 m0.004s -- From above two case , why 2nd case is taking more time ?

0 Answers  


main() { int i=-1,j=-1,k=0,l=2,m; m=i++&&j++&&k++||l++; printf("%d %d %d %d %d",i,j,k,l,m); }

1 Answers  


{ int *ptr=(int*)malloc(sizeof(int)); *ptr=4; printf("%d",(*ptr)+++*ptr++); }

4 Answers  


main() { int i = 3; for (;i++=0;) printf(ā€œ%dā€,i); }

1 Answers   CSC,






1. const char *a; 2. char* const a; 3. char const *a; -Differentiate the above declarations.

3 Answers  


Is the following code legal? struct a { int x; struct a b; }

1 Answers  


int swap(int *a,int *b) { *a=*a+*b;*b=*a-*b;*a=*a-*b; } main() { int x=10,y=20; swap(&x,&y); printf("x= %d y = %d\n",x,y); }

1 Answers  


main(){ int a= 0;int b = 20;char x =1;char y =10; if(a,b,x,y) printf("hello"); }

1 Answers   TCS,


Write a C program to add two numbers before the main function is called.

11 Answers   Infotech, TC,


write a program to Insert in a sorted list

4 Answers   Microsoft,


main() { float f=5,g=10; enum{i=10,j=20,k=50}; printf("%d\n",++k); printf("%f\n",f<<2); printf("%lf\n",f%g); printf("%lf\n",fmod(f,g)); }

1 Answers  






Categories