#include<iostream.h>
#include<iomanip.h>
#include<conio.h>
class eno
{
private:
int no,m1,m2;
char name[20];
public:
void getdata();
friend void showdata(eno);
};
void eno::getdata()
{
cout<<"Enter the No";
cin>>no;
cout<<Enter the Name";
cin>>name;
cout<<"Enter the Mark 1 & Mark2:";
cin>>m1>>m2;
}
void showdata(eno e)
{
cout<<"No="<<e.no<<endl;
cout<<"Name="<<e.name<<endl;
cout<<"Mark1="<<e.m1<<endl;
cout<<"m1>>m2;
}
void main()
{
int i;
clrscr();
eno el;
el.getdata();
showdata(el);
getch();
}
Output:
Enter the No1
Enter the Name Meena
Enter the Mark 1&Mark2:45 56
No=1
Name=Meena
Mark1=45
Mark2=56
#include<iomanip.h>
#include<conio.h>
class eno
{
private:
int no,m1,m2;
char name[20];
public:
void getdata();
friend void showdata(eno);
};
void eno::getdata()
{
cout<<"Enter the No";
cin>>no;
cout<<Enter the Name";
cin>>name;
cout<<"Enter the Mark 1 & Mark2:";
cin>>m1>>m2;
}
void showdata(eno e)
{
cout<<"No="<<e.no<<endl;
cout<<"Name="<<e.name<<endl;
cout<<"Mark1="<<e.m1<<endl;
cout<<"m1>>m2;
}
void main()
{
int i;
clrscr();
eno el;
el.getdata();
showdata(el);
getch();
}
Output:
Enter the No1
Enter the Name Meena
Enter the Mark 1&Mark2:45 56
No=1
Name=Meena
Mark1=45
Mark2=56
No comments:
Post a Comment