Question:
Write a statement that declared an enumerated data type called weekday with the values sun, mon, tue, wed, t?
xtinct
2009-09-02 05:45:27 UTC
Write a statement that declared an enumerated data type called weekday with the values
sun, mon, tue, wed, thur, fri, sat
Five answers:
swami060
2009-09-02 06:59:09 UTC
enum weekday { sun, mon, tue, wed, thur, fri, sat };
?
2009-09-02 09:00:11 UTC
Enumerated data type is used when we use a set of data many times in our program. Declarative statement for enumerated data type weekdays is:



enum weekdays{sun,mon,tue,wed,thur,fri,sat};



While calling it in the main() function following syntax can be used:



weekdays wk;
?
2009-09-02 07:17:50 UTC
i wish to explain the above answer which is the same as i thought



enum weekday{sun,mon,tue,wed,thu,fri,sat};



this is declaration statement



just think.



a variable of type int can have any value from -32768 to +32767



similarly here we have designed such that a variable of type "weekday" can have only any of the seven values from sun to sat



eg:

weekday day;

day=sun; //correct

day=mon

.

.

.

.

day=sat;//correct



day=5//wrong
?
2016-12-17 14:52:43 UTC
What language? The syntax for delclaring an array is diverse in diverse languages. a pair of examples: in C it is: double products[one hundred]; In Java, it is: double products[] = new double[one hundred];
Zeratul
2009-09-02 23:14:07 UTC
i agree with her


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...