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
void main(){ int a; a=1; while(a-->=1) while(a-->=0); printf("%d",a); }
Why is main function so important?
how many types of operators are include in c language a) 4 b) 6 c) 8 d) 12
What is #ifdef ? What is its application?
what is the diffrenet bettwen HTTP and internet protocol
Tell us something about keyword 'auto'.
What is a null pointer in c?
A function can make the value of a variable available to another by a) declaring the variable as global variable b) Passing the variable as a parameter to the second function c) Either of the two methods in (A) and (B) d) binary stream
Write a program to check palindrome number in c programming?
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 a class c rental property?
How do you use a 'Local Block'?
What are all different types of pointers in c?
What is the difference between int main and void main in c?
How do you convert strings to numbers in C?