Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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 Help Members By Posting Answers For Below Questions

Can we change the value of static variable in c?

974


Is there any data type in c with variable size?

1036


Why should I use standard library functions instead of writing my own?

1209


find out largest elemant of diagonalmatrix

2175


FILE *fp1,*fp2; fp1=fopen("one","w") fp2=fopen("one","w") fputc('A',fp1) fputc('B',fp2) fclose(fp1) fclose(fp2)} a.error b. c. d.

1708


What does static variable mean in c?

1063


Why structure is used in c?

1116


Why n++ execute faster than n+1 ?

2851


PLS U SENS ME INTERVIEW O. MY EMAIL ADD, SOFIYA.SINGH@GMAIL.COM

2146


can any one provide me the notes of data structure for ignou cs-62 paper

2120


Is boolean a datatype in c?

1014


On most computers additional memory that is accessed through an adapter of feature card along with a device driver program. a) user memory b) conventional memory c) expandedmemory d) area

1073


develop algorithms to add polynomials (i) in one variable

2111


how to create duplicate link list using C???

2505


What does *p++ do?

983