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
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 |
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 |
please give code for this 1 2 4 7 11 16
What are Storage Classes in C ?
32 Answers CTS, HP, IBM, Maharaja Whiteline, Tamil Nadu Open University TNOU, TATA, TCS, Wipro,
Develop a flow chart and write a c program to find the roots of a quadratic equation ax2+bx+c=0 using switch and break statement.
Why do we need volatile in c?
what is the difference b/w NULL and null?
What is the meaning of int *x[]();?
How do I get a null pointer in my programs?
How do I convert a string to all upper or lower case?
Given an array of 1s and 0s arrange the 1s together and 0s together in a single scan of the array. Optimize the boundary conditions?
What is #define size in c?
please can any one suggest me best useful video tutorials on c i am science graduate.please help me.u can email me to sas29@in.com
wat is the output #define VOLEDEMORT _who_must_not_be_named int main() { printf("VOLEDEMORT"); }