main()
{
enum{red,green,blue=6,white};
pf("%d%d%d%d", red,green,blue,white);
return 0;
}
a)0 1 6 2
b)0 1 6 7
c)Compilation error
d)None of the above
Answers were Sorted based on User's Feedback
Answer / aswini
how ur answer is c.can u explain that???
i think its b...
| Is This Answer Correct ? | 19 Yes | 1 No |
Answer / nitin.ramola
An enum is a user-defined type consisting of a set of named
constants called enumerators. The colors of the rainbow
would be mapped like this.:
enum rainbowcolors {
red,
orange,
yellow,
green,
blue,
indigo,
violet)
}
Now internally, the compiler will use an int to hold these
and if no values are supplied, red will be 0, orange is 1 etc.
| Is This Answer Correct ? | 1 Yes | 0 No |
What does the c preprocessor do?
write a program for egyptian fractions in c?
why arguments can generally be passed to functions a) sending the values of the arguments b) sending the addresses of the arguments c) a & b d) none of the above
Write a program that receives as input a number omaadel-n-print, four digits.
what would be the output of the following program main() { int a[] = {1,2,3,4,5}; int *ptr = {a,a+1,a+2,a+3,a+4}; printf("%d %d %d %d",a,*ptr,**ptr,ptr); } }
what is const volatile?
What is Lazy evaluation in C? Give an example.
#ifdef TRUE int I=0; #endif main() { int j=0; printf("%d %d\n",i,j); }
how to find the size of the data type like int,float without using the sizeof operator?
how much salary u want ? why u join in our company? your domain is core sector why u prefer software ?
Look at the Code: #include<string.h> void main() { char s1[]="abcd"; char s2[10]; char s3[]="efgh"; int i; clrscr(); i=strcmp(strcat(s3,ctrcpy(s2,s1))strcat(s3,"abcd")); printf("%d",i); } What will be the output? A)No output B) A Non Integer C)0 D) Garbage
Who developed c language?