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

Is it necessary to learn the C language and also C++ before joining an engineering college?
it is not necessary to learn C and C++, but if you want to make your are career in computer then learn C & C++ because these are basic computer language.
J.k.kavyadharshini
How would you round off a value from 1.66 to 2.0?
using ceil function. i.e. ceil(1.66)
Dhanya
0 0
6
What is a calling function in C?
Calling function is the one where the function call has been made and after executing the called function, control returns to the calling function.
Gowre
0 0
5
How do I learn C programming by videos or books?
BOOKS AND PRACTICE by far remain the best way for learning any language ....
Fgrefg
0 0
7
I’ve been learning C language for 3 weeks but it’s becoming more difficult. As a result, I’m becoming lazy. What should I do to motivate myself?
Learn algorithm or flowchart first. Once you start C, try to relate with real time example. Example: When learn printf() , think about a a bill where you customer information is printed. Similarly when...
Akhilesh
0 0
5

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

Ask a Question

Related Lessons

Design your own Mouse Driver in C Language
Mouse Driver (msdrv.h) #include #include union REGS i,o; restrictmouseptr(int x1, int y1, int x2, int y2) { i.x.ax=7; i.x.cx=x1; i.x.dx=x2; ...

How to write shared library program using C Programming?
Library Name : hellofilename : hello.c#include void Hello(){ printf("Hello World .. How are you 1\n");}======================================Header File:hello.h#ifndef __HELLO_H#define __HELLO_Hvoid Hello(void);#endif===============================Application...

All About Programming And A Good Programmer.
Hi, This is my first lesson for you guys. Hope you enjoy reading it. In recent community questions, I found many people wanted to be good programmers, or wanted to have good hands on certain language,...

Tress And Its Traversal
Depth First Traversals:(a) Inorder (Left, Root, Right) : 4 2 5 1 3(b) Preorder (Root, Left, Right) : 1 2 4 5 3(c) Postorder (Left, Right, Root) : 4 5 2 3 1 Trees are one of the data structures like...

Be prepared to get trained--init
Before starting the training,students must be mentally prepared for acceptance of new knowledge. Students must attend training with open minded forgetting the position they are working.This will help...
S

Smartnub Softsolutions

0 0
0

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 >

Hadoop is a framework which has been developed for organizing and analysing big chunks of data for a business. Suppose you have a file larger than your system’s storage capacity and you can’t store it. Hadoop helps in storing bigger files than what could be stored on one particular server. You can therefore store very,...

Read full article >

Information technology consultancy or Information technology consulting is a specialized field in which one can set their focus on providing advisory services to business firms on finding ways to use innovations in information technology to further their business and meet the objectives of the business. Not only does...

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