Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

PROGRAM:-

#include<iostream>

#include<conio.h>

#include<process.h>

#include<string>

using namespace std;

class student

public:

int roll;

string na;

string name,add;

student()

cout<<"Enter the Student Name:-";

cin>>name;

cout<<"\nEnter the Student Roll_No:-";

cin>>roll;

cout<<"\nEnter the Student Address:-";

cin>>add;

student(string n)

na=n;

cout<<na;

student(student &sa)

{
name=sa.name;

roll=sa.roll;

add=sa.add;

void display()

cout<<"\nThe Student Name:-"<<name;

cout<<"\nThe Student Roll_No:-"<<roll;

cout<<"\nThe Student Address:-"<<add;

~student()

cout<<"\nThis will destroy the details of students";

};

int main()

student c;

student a("This is the Student Details Program");

cout<<"\n"<<a.na;

student b=c;

c.display();

b.display();

getch();

return 0;

}
OUTPUT:-

You might also like