0 votes 0 votes What will be the output of the following program? void main( ) { enum months{July, August, September = 400, October, November = 500, December = 600}; printf("%d, %d, %d, %d, %d, %d", July, August, September, October, November, December); } Rohan Mundhey asked Oct 7, 2016 Rohan Mundhey 466 views answer comment Share Follow See 1 comment See all 1 1 comment reply mcjoshi commented Oct 7, 2016 reply Follow Share Enum is similar to integer constants which is initialized to zero and increment by $1$ for next variable. So, July $= 0$, August $= 1$, September $= 400$, October $= 401$, November $= 500$ and December $= 600$ Output : 0, 1, 400, 401, 500, 600 1 votes 1 votes Please log in or register to add a comment.
Best answer 2 votes 2 votes Default value of initial enum is 0 (if not assigned explicity) and it then increase by 1. So, program will print 0 1 400 401 500 600. amitlko answered Oct 7, 2016 selected Oct 7, 2016 by ManojK amitlko comment Share Follow See all 0 reply Please log in or register to add a comment.