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

Write a C program to remove the repeated characters in the entered expression or in entered characters(i.e) removing duplicates

3 Answers  


Program to simulate second clock

2 Answers  


What is diffrance between declaration and defination of a variable or function

4 Answers  


What is the use of extern in c?

0 Answers  


what is software?

7 Answers   Wipro,






Write a program to generate prime factors of a given integer?

9 Answers   Microsoft,


If input is 123 then how to print 100 and 20 and 3 seperately?

4 Answers  


Define macros.

0 Answers   Tech Mahindra,


suppose there are five integers write a program to find larger among them without using if- else

2 Answers  


what is the difference b/w NULL and null?

3 Answers   HSBC, IBM,


Tell us the difference between these two : #include"stdio.h" #include<stdio.h> define in detial.

5 Answers  


Which of the Following will define a type NODE that is a node in a Linked list? A)struct node {NODE*next;int x;};type def struct node NODE; B)typedef struct NODE {struct NODE *next;int x;}; C)typedef struct NODE {NODE *next;int x;}; D)typedef struct {NODE *next;int x;}NODE;

5 Answers   Accenture, TCS,


Categories