India Languages, asked by MisalPav, 1 year ago

enum(a=-1,b=3,c,d,e)what is value of e?

Answers

Answered by poojan
7

6 is the value of 'e' in enum number{a=-1,b=3,c,d,e};

Explanation :

Seems like you have made a mistake in following the syntax of enum.

enum(a=-1,b=3,c,d,e); raises an error.

error: expected ‘{’ before ‘(’ token

Program :

enum number{a=-1,b=3,c,d,e};  

int main()  

{  

enum number num;  

num = e;  

printf("e = %d",e);  

return 0;  

}

Output :

e=6

Here,

keyword = enum

enum variable = number

enumerator values = enum number{a=-1,b=3,c,d,e}; where -1 in a is a's state, and 3 in b=3 is b's state.

The next constant states of enumerators c, d, e are incremented by one from the state value of before enumberator b=3 on every pass.

As b=3,

c's value will be 3+1 = 4

d's value will be 4+1 = 5

e's value will be 5+1 = 6

Therefore, the value of e is 6.

Learn more :

1. What is list comprehension python?

brainly.in/question/6964716

2. Noisy values are the values that are valid for the dataset, but are incorrectly recorded. Is it?

brainly.in/question/6658996

Similar questions