You are on page 1of 6

INDEX

Sr DATE OF
PAGE DATE OF TEACHER
No. NAME OF EXPERIMENT SUBMISION
NO. EXPERIMENT SINGNATURE

1. Writre a program to print a message. 1

Write a program to use airthmatic 2


2. operation.

write a program that uses a class 3


3. where the member funtions are 02-sep-2022
defined outside a class.
write a program that uses a class 4
4. where the member funtions are 02-sep-2022
defined outside a class.
5.
1. Writre a program to print a message.

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:-

You might also like