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...


What is the output for the program given below

typedef enum grade{GOOD,BAD,WORST,}BAD;
main()
{
BAD g1;
g1=1;
printf("%d",g1);
}

Answers were Sorted based on User's Feedback



What is the output for the program given below typedef enum grade{GOOD,BAD,WORST,}BAD; ..

Answer / chris_sreekanth

1

Is This Answer Correct ?    9 Yes 0 No

What is the output for the program given below typedef enum grade{GOOD,BAD,WORST,}BAD; ..

Answer / ashwin kumar

error is the answer as 2nd person answer

we can remove error by changing code as follows
typedef enum grade{GOOD,BAD,WORST,} bad;
main()
{
bad g1;
g1=1;
printf("%d",g1);
}

out is 1 for above code






actual error in 1st code is declearing same variable 'BAD'

at two place in enum




if my answer is wrong or any corrections are made by u plz
inform me


molugu.ashwin@gmail.com

Is This Answer Correct ?    3 Yes 0 No

What is the output for the program given below typedef enum grade{GOOD,BAD,WORST,}BAD; ..

Answer / fefrf

In linux you get following error
enum.c:2: error: `BAD' redeclared as different kind of symbol
enum.c:2: error: previous declaration of `BAD'

Is This Answer Correct ?    2 Yes 0 No

What is the output for the program given below typedef enum grade{GOOD,BAD,WORST,}BAD; ..

Answer / vijay r15

error

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More C Interview Questions

What is the right type to use for boolean values in c? Is there a standard type?

0 Answers  


What is difference between the following 2 lines…. int temp = (int)(0x00); int temp = (0x00int);

3 Answers   Bosch,


Write code for finding depth of tree

2 Answers   Adobe,


Is fortran still used today?

0 Answers  


what is ANSI and ISO

7 Answers   HCL,


void main() { char far *farther,*farthest; printf("%d..%d",sizeof(farther),sizeof(farthest)); }

3 Answers   ME, pspl,


a simple c program using 'for' loop to display the output 5 4 3 2 1

2 Answers   Google,


Function which gives a pointer to a binary trees const an integer value at each code, return function of all the nodes in binary tree.?

0 Answers   Infosys,


what is c programming?

3 Answers   TCS,


Explain what happens if you free a pointer twice?

0 Answers  


Is that possible to store 32768 in an int data type variable?

0 Answers  


What are # preprocessor operator in c?

0 Answers  


Categories