How do I convert these to member functions

friend ostream& operator<< (ostream& c, positive_fraction f1);
{
if (f1.top == 0)co <<0;
if (f1.top >=f1.bottom)
{
co << f1.top / f1.bottom !=0;
if (f1.top % f1.bottom !=0)
co << "and";
}
if (f1.top % f1.bottom != 0)
co << f1.top % f1.bottom << "/" << f1.bottom;
return co;
}


friend istream& operator>> (istream& c, positive_fraction& f1);

{
char ch;
int s,t;
c>>s>>ch>>t;
if (ch !='/') return c;
f1.assign (s,t);
return c;
}