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 |
Differentiate b/w Modify and Update commands giving example.
Can you assign a different address to an array tag?
Write a program to enter the name and age. If age>28 then find salary categories. if age<28 then find that you are gaduate or not.
How to establish connection with oracle database software from c language?
swapping of two numbers without using third variable using AND and OR operators
What is null character in c?
write a program for odd numbers?
What is scope rule in c?
What is Conio.h ?
Was 2000 a leap year?
What is declaration and definition in c?
write a c program to calculate sum of digits till it reduces to a single digit using recursion