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
please explain every phase in the "SDLC" in the dotnet.
What is the difference between array_name and &array_name?
in ‘C’ language for Matrix Multiplication fails” Introspect the causes for its failure and write down the possible reasons for its failure.
please help me..... please codes and flowchart plz turbo c lang po yan.....please asap response... 3. Make an astrology program. The user types in his or her birthday (month, day, and year as integer), and the program responds with the user’s zodiac sign, horoscope, and other information related to it. If the user’s birth year falls into a leap year, your program should display an appropriate message for it. NOTES: Conditional Statements: it should be with graphics
For what purpose null pointer used?
What should malloc(0) do? Return a null pointer or a pointer to 0 bytes?
What is pointer to pointer in c language?
What is the benefit of using an enum rather than a #define constant?
what are # pragma staments?
What is a rvalue?
What is difference between stdio h and conio h?
Explain what is the benefit of using an enum rather than a #define constant?
Differentiate between declaring a variable and defining a variable?
What are the advantages of using linked list for tree construction?
What are the advantages of using Unions?