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 |
What is the right type to use for boolean values in c? Is there a standard type?
What is difference between the following 2 lines…. int temp = (int)(0x00); int temp = (0x00int);
Write code for finding depth of tree
Is fortran still used today?
what is ANSI and ISO
void main() { char far *farther,*farthest; printf("%d..%d",sizeof(farther),sizeof(farthest)); }
a simple c program using 'for' loop to display the output 5 4 3 2 1
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.?
what is c programming?
Explain what happens if you free a pointer twice?
Is that possible to store 32768 in an int data type variable?
What are # preprocessor operator in c?