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

a=0; while(a<5) printf("%d\n",a++); how many times does the loop occurs? a.infinite b.5 c.4 d.6

7 Answers   TCS,


Example of friendly function in c++

2 Answers  


main() { int x=2, y=4 if ((x==2||y==4) x++ y++ if (y==4+1) { x=x+y; } y++; printf("The values of x and y are %d and %d."x,y); } What is the output?

5 Answers   TCS,


how to print this sereis 2 4 3 6 5..........?

3 Answers  


In the below code, how do you modify the value 'a' and print in the function. You'll be allowed to add code only inside the called function. main() { int a=5; function(); // no parameters should be passed } function() { /* add code here to modify the value of and print here */ }

1 Answers  






What is wrong with this program statement?

0 Answers  


int a=2,b=3,c=4; printf("a=%d,b=%d\n",a,b,c); what is the o/p?

6 Answers   Verifone,


What is a program flowchart and explain how does it help in writing a program?

0 Answers  


int main() { int i=-1,j=-1;k=0,l=2,m; m=i++&&j++&&k++||l++; printf("%d%d%d%d%d",i,j,k,l,m); }

3 Answers   HCL,


What is mean by data types in c?

0 Answers  


How can I implement sets or arrays of bits?

0 Answers  


to write a program, that finds the minimum total number of shelves, including the initial one, required for this loading process. The packets are named A, B, C, D, E &#133;&#133;.. Any numbers of packets with these names could be kept in the shelf, as in this example: [ZZLLAAJKRDFDDUUGGYFYYKK]. All packets are to be loaded on cars. The cars are lined in order, so that the packets could be loaded on them. The cars are also named [A, B, C, D, E,&#133;&#133;&#133;&#133;.].

2 Answers   Infosys, TCS,


Categories