What is the output for the program given below
typedef enum grade{GOOD,BAD,WORST,}BAD;
main()
{
BAD g1;
g1=1;
printf("%d",g1);
}
Answer Posted / 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 |
Post New Answer View All Answers
Is stack a keyword in c?
Why we use stdio h in c?
What are the application of c?
What is p in text message?
Explain modulus operator.
How can I manipulate individual bits?
Why we write conio h in c?
What is wild pointer in c with example?
How do c compilers work?
Can variables be declared anywhere in c?
What is struct node in c?
Can a function be forced to be inline? Also, give a comparison between inline function and the C macro?
explain what are pointers?
Can I initialize unions?
What is a stream?