hi there im trying to make a math program
the input is
a/b # c/d
# = / or + or - or *
example
input
1/4 / 1/4
output
1
input
2/7 - 4/14
output
0
input
4/5 + 4/7
output
1 13/35
input
2/3 * 4/5
output
8/15
this is my code for only + sign math program
Code:
#include <stdio.h>
#include <conio.h>
int main(void){
int a, b, c, d, e, f, g;
scanf("%d/%d%d/%d", &a, &b, &c, &d);
b > 0;
d > 0;
e = (a * d) + (b * c);
f = b * d;
if(e < f)
printf("%d/%d + %d/%d = %d/%d", a, b, c, d, e, f);
if(e > f)
printf("%d/%d + %d/%d = %d %d/%d", a, b, c, d, e / f, e % f, f);
if(e == f)
printf("%d/%d + %d/%d = 1", a, b, c, d);
return 1;
}
my question is how to replace # in input with / or * or + or -
sorry for my bad english tq