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 |
A C E G H +B D F A I ------------ E F G H D
what is difference between ++(*p) and (*p)++
17 Answers Accenture, HCL, IBM,
Explain what are preprocessor directives?
Explain the red-black trees?
What does void main () mean?
Do pointers take up memory?
What will be printed as the result of the operation below: #include<..> int x; int modifyvalue() { return(x+=10); } int changevalue(int x) { return(x+=1); } void main() { int x=10; x++; changevalue(x); x++; modifyvalue(); printf("First output:%d\n",x); x++; changevalue(x); printf("Second output:%d\n",x); modifyvalue(); printf("Third output:%d\n",x); }
Mention four important string handling functions in c languages .
who is the editor of 'pokemon'?
Why can't we initialise member variable of a strucutre
What is the collection of communication lines and routers called?
main() { int a[3][4] ={1,2,3,4,5,6,7,8,9,10,11,12} ; int i, j , k=99 ; for(i=0;i<3;i++) for(j=0;j<4;j++) if(a[i][j] < k) k = a[i][j]; printf("%d", k); }
4 Answers Vector, Wipro, Zoho,