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



main() { enum{red,green,blue=6,white}; pf("%d%d%d%d", red,green,blue,white); return 0;..

Answer / aswini

how ur answer is c.can u explain that???
i think its b...

Is This Answer Correct ?    19 Yes 1 No

main() { enum{red,green,blue=6,white}; pf("%d%d%d%d", red,green,blue,white); return 0;..

Answer / rajesh

Answer : b

check it in www.codepad.org

Is This Answer Correct ?    6 Yes 0 No

main() { enum{red,green,blue=6,white}; pf("%d%d%d%d", red,green,blue,white); return 0;..

Answer / saiteja

0167

Is This Answer Correct ?    3 Yes 0 No

main() { enum{red,green,blue=6,white}; pf("%d%d%d%d", red,green,blue,white); return 0;..

Answer / niranjan kumar niraj

d)none of the above

Is This Answer Correct ?    3 Yes 2 No

main() { enum{red,green,blue=6,white}; pf("%d%d%d%d", red,green,blue,white); return 0;..

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

main() { enum{red,green,blue=6,white}; pf("%d%d%d%d", red,green,blue,white); return 0;..

Answer / kalai

c

Is This Answer Correct ?    2 Yes 3 No

Post New Answer

More C Interview Questions

What is an lvalue?

0 Answers  


Explain how can I make sure that my program is the only one accessing a file?

0 Answers  


What is the incorrect operator form following list(== , <> , >= , <=) and what is the reason for the answer?

0 Answers  


main is a predefined or user define function if user defined why? if predefined whay?

12 Answers   TCS,


What is structure padding & expalain wid example what is bit wise structure?

1 Answers  






What is assert and when would I use it?

0 Answers  


write a program of bubble sort using pointer?

3 Answers   TCS,


Is this program statement valid? INT = 10.50;

0 Answers  


What is return type in c?

0 Answers  


How to establish connection with oracle database software from c language?

0 Answers  


write a c program to remove all the duplicate characters in a string and replace with single character? ex:-input- AAABBBCCC output- ABC

2 Answers   HCL,


What is the difference between printf and scanf in c?

0 Answers  


Categories