Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

Explain continue keyword in c

0 Answers  


how to find anagram without using string functions using only loops in c programming

1 Answers   Mind Tree, TCS,


Why is c called c not d or e?

0 Answers  


the portion of a computer program within which the definition of the variable remains unchanged a) mode b) module c) scope d) none

0 Answers  


write C code to reverse a string such that if i/p is "abc defg hij klmno pqrs tuv wxyz" and the o/p should be "cba gfed jih onmlk srqp vut zyxw"

2 Answers  


#define MAX 3 main() { printf("MAX = %d ",MAX ); #undef MAX #ifdef MAX printf("Vector Institute”); #endif }

1 Answers   Vector India,


Write a program to generate random numbers in c?

0 Answers  


How to avoid structure padding in C?

8 Answers   Tech Mahindra,


Which of the Following is not defined in string.h? A)strspn() B)strerror() C)memchr() D)strod()

2 Answers   Accenture, TCS,


What is New modifiers?

0 Answers   NA,


what is array?

63 Answers   Amdocs, HCL,


What will be the result of the following program? char*g() { static char x[1024]; return x; } main() { char*g1="First String"; strcpy(g(),g1); g1=g(); strcpy(g1,"Second String"); printf("Answer is:%s", g()); } (A) Answer is: First String (B) Answer is: Second String (C) Run time Error/Core Dump (D) None of these

2 Answers   Oracle,


Categories