Thursday 10 June 2021

Enumerated data type 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.

1. The keyword enum is used to define enumeration data types in C.

#include<stdio.h>
int main()
{
enum week day;
day=wed;
printf("%d",day);
return 0;
} 

you can also assign your own constant values

Example:

enum grade{first=60, second=50, third};

In the above example the value of third is zero.

0 comments :

Post a Comment

Note: only a member of this blog may post a comment.

Machine Learning

More

Advertisement

Java Tutorial

More

UGC NET CS TUTORIAL

MFCS
COA
PL-CG
DBMS
OPERATING SYSTEM
SOFTWARE ENG
DSA
TOC-CD
ARTIFICIAL INT

C Programming

More

Python Tutorial

More

Data Structures

More

computer Organization

More
Top