hello, I'm somewhat new to c# and am trying to make/reduce fractions. the numbers only range from 1 through 10.

i was thinking about using a bool true/false to check if the numerator divides by the denominator and still produce ints and not floats. such as 2/10 = 1/5

I was also thinking about maybe using a while loop to run through the division and keep subtracting by one until it reaches 0 to check everynumber

I really need help on this soon b/c the prog is due today

You need to find the gcd of the numerator and denominator and divide them with it.

a/b = a/gcd(a,b) / b/gcd(a,b)

This is how you find the GCD

commented: Nice :) +7
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.