#include
int num;
int den; };
struct rational sum(struct rational a, struct rational b) {
struct rational c;
c.num= a.num*b.den+b.num*a.den; c.den=a.num*b.den;
return c;
}
int main() {
struct rational x,y,z;
printf("Enter all values:");
scanf("%d %d %d %d",&x.num,&x.den,&y.num,&y.den); z=sum(x,y);
printf("The sum is %d/%d",z.num,z.den);
return 0; }