how I can simplify fraction after do some process on it
(add, sub...)
this part of program (add fraction)
int i,j,k,m,a,b,c,d;
char x;
printf("Please Enter fraction number 1\n");
scanf( "%d%c%d",&a,&x,&b);
printf("please Enter fraction number 2\n");
scanf("%d%c%d",&c,&x,&d);
if (b == 0 || d == 0){
printf("undife number\n");
system ("pause");
}
else if(a == 0){
printf("number1-number2=%d/%d\n",c,d);
system ("pause");
}
else if (c == 0) {
printf("number1-number2=%d/%d\n",a,b);
system ("pause");
}
i=a*d;
j=b*c;
k=i+j;
m=b*d;
printf("its = %d/%d\n",k,m);