#include<iostream.h>
class mark{
int m;
public:
friend istream & operator>>(istream &, mark &);
friend ostream & operator<<(ostream &, mark &);
};
istream & operator>>(istream &, mark &)
{
cout<<"Get Number";
cin>>m;
}
ostream & operator<<(ostream &,mark &)
{
cout<<"Given number="<<m;
}
void main()
{
mark k;
cin>>k;
cout<<k;
}
class mark{
int m;
public:
friend istream & operator>>(istream &, mark &);
friend ostream & operator<<(ostream &, mark &);
};
istream & operator>>(istream &, mark &)
{
cout<<"Get Number";
cin>>m;
}
ostream & operator<<(ostream &,mark &)
{
cout<<"Given number="<<m;
}
void main()
{
mark k;
cin>>k;
cout<<k;
}
No comments:
Post a Comment