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
Input is "rama loves rajesh and rajesh Loves rama also and rajesh wear gloves and bloves" To print output is count the numbers of times repeted the word love without case sensitive.
What are the different types of pointers used in c language?
using for loop sum 2 number of any 4 digit number in c language
ATM machine and railway reservation class/object diagram
What is build process in c?
Is that possible to add pointers to each other?
Explain what is the purpose of "extern" keyword in a function declaration?
What are the types of macro formats?
Why structure is used in c?
In the DOS enveronment, normal RAM that resides beyond the 1mb mark. a) expanded memory b) swapped memory c) Extended memory d) none
Explain the advantages and disadvantages of macros.
How can I read/write structures from/to data files?
Tell me about low level programming languages.
What is the purpose of void pointer?
Differentiate between null and void pointers.