Professional Documents
Culture Documents
Oop Practical
Oop Practical
Sr DATE OF
PAGE DATE OF TEACHER
No. NAME OF EXPERIMENT SUBMISION
NO. EXPERIMENT SINGNATURE
program:-
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr ();
cout<<”prashant kumar”;
return 0;
}
Output---
2.Write a program to use airthmatic operation.
Program:-
#include<iostream.h>
#include<conio.h>
void main ()
{
clrscr ();
int a, b,
3. write a program that uses a class where the member funtions are defined inside a
class.
Program:-
#inlcude<iostream.h>
#include<conio.h>
class student
{
int s_no;
char s_name[10];
public:
void accept()
{
cout<<”Enter s_no:”;
cin>>s_no;
cout<<Enter s_name:”;
cin>>s_name;
}
void display ()
{
cout<<”s_no; <<s_no:
cout<<”s_name:”<<s_name;
}
};
void main()
{
student s;
clrscr();
s_accept ();
s_display();
getch();
}
Output:-
4. Write a program that 3uses a class where the member funntion are defined outside
a class.
Program:-
#inlcude<iostream.h>
#include<conio.h>
class student
{
int s_no;
char s_name[10];
public:
void accept();
void display ();
{
cout<<”s_no:”<<s_no;
cout<<”s_name:”<<s_name;
}
};
void student::accept ()
{
cout<<”enter s_no”;
cin>>s_no;
cout<<”Enter s_name:”;
cin>>s_name;
}
void main()
{
student s;
clrscr();
s_accept ();
s_display();
getch();
}
Output:-