UrbanPro

Learn C Language from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

What is meant by “enum” in C?

Asked by Last Modified  

Follow 7
Answer

Please enter your answer

Computer classes For Working professionals and studne of Engineering, MCA, Class 12,11 class 10

An enum is a keyword in C language, it is an user defined data type. All properties of integer are applied on Enumeration data type It work like the Integer.
Comments

In computer programming, an enumerated type (also called enumeration, enum, or factor in the R programming language, and a categorical variable in statistics) is a data type consisting of a set of named values called elements, members, enumeral, or enumerators of the type.
Comments

. 16yrs experience as java selenium automation Architect

n computer programming, an enumerated type is a data type consisting of a set of named values called elements, members, enumeral, or enumerators of the type. The enumerator names are usually identifiers that behave as constants in the language. An enumerated type can be seen as a degenerate tagged union...
read more

n computer programming, an enumerated type is a data type consisting of a set of named values called elements, members, enumeral, or enumerators of the type. The enumerator names are usually identifiers that behave as constants in the language. An enumerated type can be seen as a degenerate tagged union of unit type

read less
Comments

Primary Teacher

In programming Enum is a keyword defined for Enumeration a new data type. Type safe enumerations should be used liberally.In particular, they are a robust alternative to the simple String or int constants used in many older APIs to represent sets of related items. Enumeration (or enum) in C. Enumeration...
read more

 In programming Enum is a keyword defined for Enumeration a new data type. Type safe enumerations should be used liberally.In particular, they are a robust alternative to the simple String or int constants used in many older APIs to represent sets of related items.

Enumeration (or enum) in C. Enumeration (or enum) is a user defined data type in C. It is mainly used to assign names to integral constants, the names make a program easy to read and maintain. enum State {Working = 1, Failed = 0}; The keyword 'enum' is used to declare new enumeration types in C and C++.

read less
Comments

Primary Teacher

In programming Enum is a keyword defined for Enumeration a new data type. Type safe enumerations should be used liberally.In particular, they are a robust alternative to the simple String or int constants used in many older APIs to represent sets of related items. Enumeration (or enum) in C. Enumeration...
read more

 In programming Enum is a keyword defined for Enumeration a new data type. Type safe enumerations should be used liberally.In particular, they are a robust alternative to the simple String or int constants used in many older APIs to represent sets of related items.

Enumeration (or enum) in C. Enumeration (or enum) is a user defined data type in C. It is mainly used to assign names to integral constants, the names make a program easy to read and maintain. enum State {Working = 1, Failed = 0}; The keyword 'enum' is used to declare new enumeration types in C and C++.

read less
Comments

Primary Teacher

In programming Enum is a keyword defined for Enumeration a new data type. Type safe enumerations should be used liberally.In particular, they are a robust alternative to the simple String or int constants used in many older APIs to represent sets of related items. Enumeration (or enum) in C. Enumeration...
read more

 In programming Enum is a keyword defined for Enumeration a new data type. Type safe enumerations should be used liberally.In particular, they are a robust alternative to the simple String or int constants used in many older APIs to represent sets of related items.

Enumeration (or enum) in C. Enumeration (or enum) is a user defined data type in C. It is mainly used to assign names to integral constants, the names make a program easy to read and maintain. enum State {Working = 1, Failed = 0}; The keyword 'enum' is used to declare new enumeration types in C and C++.

read less
Comments

Primary Teacher

In programming Enum is a keyword defined for Enumeration a new data type. Type safe enumerations should be used liberally.In particular, they are a robust alternative to the simple String or int constants used in many older APIs to represent sets of related items. Enumeration (or enum) in C. Enumeration...
read more

 In programming Enum is a keyword defined for Enumeration a new data type. Type safe enumerations should be used liberally.In particular, they are a robust alternative to the simple String or int constants used in many older APIs to represent sets of related items.

Enumeration (or enum) in C. Enumeration (or enum) is a user defined data type in C. It is mainly used to assign names to integral constants, the names make a program easy to read and maintain. enum State {Working = 1, Failed = 0}; The keyword 'enum' is used to declare new enumeration types in C and C++.

read less
Comments

Primary Teacher

In programming Enum is a keyword defined for Enumeration a new data type. Type safe enumerations should be used liberally.In particular, they are a robust alternative to the simple String or int constants used in many older APIs to represent sets of related items. Enumeration (or enum) in C. Enumeration...
read more

 In programming Enum is a keyword defined for Enumeration a new data type. Type safe enumerations should be used liberally.In particular, they are a robust alternative to the simple String or int constants used in many older APIs to represent sets of related items.

Enumeration (or enum) in C. Enumeration (or enum) is a user defined data type in C. It is mainly used to assign names to integral constants, the names make a program easy to read and maintain. enum State {Working = 1, Failed = 0}; The keyword 'enum' is used to declare new enumeration types in C and C++.

read less
Comments

Primary Teacher

In programming Enum is a keyword defined for Enumeration a new data type. Type safe enumerations should be used liberally.In particular, they are a robust alternative to the simple String or int constants used in many older APIs to represent sets of related items. Enumeration (or enum) in C. Enumeration...
read more

 In programming Enum is a keyword defined for Enumeration a new data type. Type safe enumerations should be used liberally.In particular, they are a robust alternative to the simple String or int constants used in many older APIs to represent sets of related items.

Enumeration (or enum) in C. Enumeration (or enum) is a user defined data type in C. It is mainly used to assign names to integral constants, the names make a program easy to read and maintain. enum State {Working = 1, Failed = 0}; The keyword 'enum' is used to declare new enumeration types in C and C++.

read less
Comments

Trainer

enum The enum type specifier is short for "enumerated data". The user can define a fixed set of words that a variable of type enum can take as its value. The words are assigned integer values by the compiler so that code can compare enum variables. Consider the following code example: #include stdio.h /*...
read more
enum The enum type specifier is short for "enumerated data". The user can define a fixed set of words that a variable of type enum can take as its value. The words are assigned integer values by the compiler so that code can compare enum variables. Consider the following code example: #include stdio.h /* To shorten example, not using argp */ int main () { enum compass_direction { north, east, south, west }; enum compass_direction my_direction; my_direction=west; return 0; } This example defines an enumerated variable type called compass_direction, which can be assigned one of four enumerated values: north, east, south, or west. It then declares a variable called my_direction of the enumerated compass_direction type, and assigns my_direction the value west. Why go to all this trouble? Because enumerated data types allow the programmer to forget about any numbers that the computer might need in order to process a list of words, and simply concentrate on using the words themselves. It's a higher-level way of doing things; in fact, at a lower level, the computer assigns each possible value in an enumerated data type an integer cconstant -- one that you do not need to worry about. Enumerated variables have a natural partner in the switch statement, as in the following code example. #include stdio.h enum compass_direction { north, east, south, west }; enum compass_direction get_direction() { return south; } /* To shorten example, not using argp */ int main () { enum compass_direction my_direction; puts ("Which way are you going?"); my_direction=get_direction(); switch (my_direction) { case north: puts("North? Say hello to the polar bears!"); break; case south: puts("South? Say hello to Tux the penguin!"); break; case east: puts("If you go far enough east, you'll be west!"); break; case west: puts("If you go far enough west, you'll be east!"); break; } return 0; } In this example, the compass_direction type has been made global, so that the get_direction function can return that type. The main function prompts the user, Which way are you going?, then calls the "dummy" function get_direction. In a "real" program, such a function would accept input from the user and return an enumerated value to main, but in this case it merely returns the value south. The output from this code example is therefore as follows: Which way are you going? South? Say hello to Tux the penguin! As mentioned above, enumerated values are converted into integer values internally by the compiler. It is practically never necessary to know what integer values the compiler assigns to the enumerated words in the list, but it may be useful to know the order of the enumerated items with respect to one another. The following code example demonstrates this. #include stdio.h /* To shorten example, not using argp */ int main () { enum planets { Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, Neptune, Pluto }; enum planets planet1, planet2; planet1=Mars; planet2=Earth; if (planet1 > planet2) puts ("Mars is farther from the Sun than Earth is."); else puts ("Earth is farther from the Sun than Mars is."); return 0; } The output from this example reads as follows: Mars is farther from the Sun than Earth is. read less
Comments

View 9 more Answers

Related Questions

Do every operator has an Associativity?
Yes, every operator will have an associativity.
Basundhara
0 0
5
What is important topics in C-language for interviews???
Functions, Arrays , String, pointers , structures
Gayu
What is the actual size of INT in the C language, 2 or 4 bytes?
The actual size to int is determined by the compiler as the program runs. But theoretically the size is 2 bytes. You can increase the size by adding keyword long infront of it to make the size 4 bytes. Eg int a; // 2 bytes Long int b; // 4 bytes
Kunal

Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com

Ask a Question

Related Lessons

PRACTISE makes you PERFECT ; ; ; There is no SUBSTITUTE for HARD WORK ;;;;Breathe SUCCESS like OXYGEN
Proper Planning ( reg what portions to be covered today) revising today's class portions & clarifying doubts solving Maths problems regularly ,noting down formulae separately trying to understand...

Pointers Concept
Every variable has a memory location and every memory location has its address defined which can be accessed using ampersand (&) operator, which denotes an address in memory. Consider the following...

Basics Of C And C++
C++ is powerful, highly flexible, and adaptable programming language that allows software engineers to organise and process information quickly and effectively. But this high-level language is relatively...

C-Program Swapping Contents Of Variables Using Function [Call By Reference Method]
//Header Files #include#include // User defined functions swap with 2 pointer variables passed as an argument list void swap(int*i,int*j){ // Local variable temp int temp; // swapping contents using...
S

C Program-Vowels and Consonants
/*WAP to print the character entered by user is a vowel or consonant*/ //Header files #include<stdio.h>#include<conio.h> //Main functionvoid main(){ char c; //Function for clearing screen...
S

Recommended Articles

Brilliant Academy is one of the reputed institutes for B.Tech tuition classes. This institute is specialised in delivering quality tuition classes for B.E, Engineering - all streams and Engineering diploma courses. Incorporated in 2012, Brillant Academy is a brainchild of Mr Jagadeesh. The main motto of the academy is to...

Read full article >

Lasya Infotech is a Hyderabad based IT training institute founded in 2016 by O Venkat. Believing in his innovation, passion and persistence and with a diverse blend of experience, he started his brainchild to deliver exemplary professional courses to aspiring candidates by honing their skills. Ever since the institute envisions...

Read full article >

Microsoft Excel is an electronic spreadsheet tool which is commonly used for financial and statistical data processing. It has been developed by Microsoft and forms a major component of the widely used Microsoft Office. From individual users to the top IT companies, Excel is used worldwide. Excel is one of the most important...

Read full article >

Almost all of us, inside the pocket, bag or on the table have a mobile phone, out of which 90% of us have a smartphone. The technology is advancing rapidly. When it comes to mobile phones, people today want much more than just making phone calls and playing games on the go. People now want instant access to all their business...

Read full article >

Looking for C Language Classes?

Learn from the Best Tutors on UrbanPro

Are you a Tutor or Training Institute?

Join UrbanPro Today to find students near you
X

Looking for C Language Classes?

The best tutors for C Language Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn C Language with the Best Tutors

The best Tutors for C Language Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more