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

Sunday 28 June 2020

Class In C++ | Class In C++ Programming Language |Class In C++ Example| Class In C++ Program| Class In C++ Syntax| Class In C++ In Hindi

Class In C++

 A class is an entity in which member variable and member function are involved so it is called class.

image of Class In C++
Fig: Class In C++

Program:

#include<iostream.h>

#include<conio.h>

class emp

{

private:

char name[10];

int age;

public:

void get()

{

cout<<”enter name”<<endl;

cin>>name;

cout<<”enter age”<<endl;

cin>>age;

}

void show()

{

cout<<”name is”<<”  “<<name<<endl;

cout<<”ag is “<<” “<<age<<endl;

}

};

void main()

{

emp e1;

e1.get();

e1.show();

getch();

}


Output:

Enter name Pramod

Enter age 21

Name is Pramod

Age is 21


No comments:

Post a Comment