enum DAY
{
sunday,
monday,
tuesday
};

enum EDAYS
{
friday,
saturday,
sunday
};

void main()
{
int i =0;
if( i == sunday)
{
printf("%d",i);
}
}
what would be the output?

Answers were Sorted based on User's Feedback



enum DAY { sunday, monday, tuesday }; enum EDAYS { friday, saturday, sunday }; vo..

Answer / rakesh kumar

Re-declaration error

Is This Answer Correct ?    4 Yes 0 No

enum DAY { sunday, monday, tuesday }; enum EDAYS { friday, saturday, sunday }; vo..

Answer / shankar

Multiple declaration for 'sun'
An error comes!!!!!!

Is This Answer Correct ?    0 Yes 0 No

enum DAY { sunday, monday, tuesday }; enum EDAYS { friday, saturday, sunday }; vo..

Answer / sumit srivastava

0

Is This Answer Correct ?    0 Yes 0 No

enum DAY { sunday, monday, tuesday }; enum EDAYS { friday, saturday, sunday }; vo..

Answer / mukesh_biswajeet

The Answer or output is 0
Sunday is at zero[0] positon in Enum Day
and therefore the condition becomes true and
the initialised value of i is printed.

Is This Answer Correct ?    0 Yes 2 No

Post New Answer

More C Interview Questions

What are volatile variables?

1 Answers   Mind Tree,


1.What is a Data Structure? Explain its need? 2.What is a Directed Graph? Write an algorithm to find whether a Directed Graph is connected or not? 3.Explain the process of converting a Tree to a Binary Tree.

4 Answers   Ignou, TCS,


what is the purpose of the code, and is there any problem with it. bool f( uint n ) { return (n & (n-1)) == 0; }

1 Answers   Google,


Program to find the sum of digits of a given number until the sum becomes a single digit

8 Answers   InterGraph,


What is data structure in c programming?

0 Answers  






`write a program to display the recomended action depends on a color of trafic light using nested if statments

0 Answers  


program to find the magic square

1 Answers   Infosys,


write a program to find out prime number using sieve case?

0 Answers   HCL,


how to find the given number is prime or not?

6 Answers   IMS, ING,


code for concatination of 2 strings with out using library functions?

3 Answers  


what is the difference between malloc() and calloc() function?

1 Answers  


Is flag a keyword in c?

0 Answers  


Categories