Online Courses
Free Tutorials  Go to Your University  Placement Preparation 
0 like 0 dislike
283 views
in JECRC University B.Tech(CSE-III Sem) Object Oriented Programming Lab by Goeduhub's Expert (7.1k points)

Program to demonstrate use of multiple classes

Goeduhub's Top Online Courses @Udemy

For Indian Students- INR 360/- || For International Students- $9.99/-

S.No.

Course Name

 Coupon

1.

Tensorflow 2 & Keras:Deep Learning & Artificial Intelligence || Labeled as Highest Rated Course by Udemy

Apply Coupon

2.

Complete Machine Learning & Data Science with Python| ML A-Z Apply Coupon

3.

Complete Python Programming from scratch | Python Projects Apply Coupon
    More Courses

1 Answer

0 like 0 dislike
by Goeduhub's Expert (7.1k points)
edited by
 
Best answer

Multi class Operation

Multiple classes can be used in a single program.

Example

#include<iostream.h>
#include<stdio.h>
#include<conio.h>

//Defining class Student
class Student
{
public:
void show()
{
cout<<"Hello I'm Student\n";
}
};

//Defining class Teacher
class Teacher
{
public:
void display()
{
cout<<"Hey I'm Teacher\n";
}
};

void main()
{
clrscr();

//Object of the class Student created
Student st;
st.show();

//Object of the class Teacher created
Teacher tc;
tc.display();
getch();
}

Output

Hello I'm Student
Hey I'm Teacher


For more Object Oriented Programming Lab Experiments Click Here

3.3k questions

7.1k answers

394 comments

4.6k users

 Goeduhub:

About Us | Contact Us || Terms & Conditions | Privacy Policy || Youtube Channel || Telegram Channel © goeduhub.com Social::   |  | 
...