i'm trying to add two fractions via a function and it works.
the problem is that i have to print the fraction in the main( and i have absolutly no idea how to do that)
other than that the program works fine.
#include<stdio.h>
#include<conio.h>
#include<iostream.h>
int frac(int,int,int,int);
void main()
{
clrscr();
int a,b,c,d;
cout<<"Enter fraction numbers"<<endl;
cin>> a>> b>> c>> d;
frac(a,b,c,d);
getch();
}
int frac(int a, int b, int c, int d)
{
int e,f;
e= (a*d + c*b);
f=d*b;
cout<<e<<'/'<<f;
return(e,f);
}
help me out please!!