How do I read a fraction into C to do math with it? (The fraction will contain the slash symbol) For example, A user will input 3/12. (a string) The program will find the gc
#include typedef struct { int num, denom; }fraction; int main() { fraction fract = {1,2}; printf("fraction: %i/%i", fract.num, fract.denom); return 0; }