TODAY JAVA SCHOOL

In java school, programming, design, computer general knowledge, web application, software, web services, social media, digital marketing, oops, concept of programming language, oops feature, console media, graphics medium, first programming, c, c ++ , Java, PHP, SQL, MySQL, HTML, HTML_5, J_query, JavaScript, Bootstrap, Framework, images with logos, examples, shared and explained.

https://www.amazon.in/b?node=26373545031&linkCode=ll2&tag=1234567801cdb-21&linkId=3b9882431b00409b44141e0344b35a15&language=en_IN&ref_=as_li_ss_tl

Breaking

Monday 24 August 2020

Enumeration in C++ | Program Of Enumeration in C++ | Syntax Of Enumeration in C++ | Definition Of Enumeration in C++ | Enumeration in C++ In Hindi

 

Enumeration in C++

Enum is a user defined data type where we specify a set of values for a variable and the variable can only take one out of a small set of possible values. We use enum keyword to define a Enumeration.

 

image of Enumeration in C++

Fig:Enumeration in C++ 

Syntax:

enum enumerated-type-name{value1, value 2, value N};

 

Example:

enum direction{east ,west, south, north} dir;

 

Program:

#include<iostream.h>

#include<conio.h>

enum direction{east ,west, south, north} dir;

void main()

{

dir=west;

cout<<dir;

getch();

}


Output:

1

 

No comments:

Post a Comment