Skip to main content
Rollback to Revision 3
Source Link
Jamal
  • 34.9k
  • 13
  • 133
  • 237
 new line of code 
 void Simplify(int [] numbers)
        {
            int gcd = GCD(numbers);
            for (int i = 0; i < numbers.Length; i++)
                numbers[i] /= gcd;
        }
        int GCD(int a, int b)
       {
            while (b>0)
            {
                int rem = a % b;
                a = b;
                b = rem;
            }
            return a;
        }
        int GCD(int[] args)
        {
            return args.Aggregate((gcd, arg) => GCD(gcd, arg));
        }        
    }

}

cant seem to get this to work any suggestions on where i could place this Thanks

 new line of code 
 void Simplify(int [] numbers)
        {
            int gcd = GCD(numbers);
            for (int i = 0; i < numbers.Length; i++)
                numbers[i] /= gcd;
        }
        int GCD(int a, int b)
       {
            while (b>0)
            {
                int rem = a % b;
                a = b;
                b = rem;
            }
            return a;
        }
        int GCD(int[] args)
        {
            return args.Aggregate((gcd, arg) => GCD(gcd, arg));
        }        
    }

}

cant seem to get this to work any suggestions on where i could place this Thanks

new code added
Source Link
 new line of code 
 void Simplify(int [] numbers)
        {
            int gcd = GCD(numbers);
            for (int i = 0; i < numbers.Length; i++)
                numbers[i] /= gcd;
        }
        int GCD(int a, int b)
       {
            while (b>0)
            {
                int rem = a % b;
                a = b;
                b = rem;
            }
            return a;
        }
        int GCD(int[] args)
        {
            return args.Aggregate((gcd, arg) => GCD(gcd, arg));
        }        
    }

}

cant seem to get this to work any suggestions on where i could place this Thanks

 new line of code 
 void Simplify(int [] numbers)
        {
            int gcd = GCD(numbers);
            for (int i = 0; i < numbers.Length; i++)
                numbers[i] /= gcd;
        }
        int GCD(int a, int b)
       {
            while (b>0)
            {
                int rem = a % b;
                a = b;
                b = rem;
            }
            return a;
        }
        int GCD(int[] args)
        {
            return args.Aggregate((gcd, arg) => GCD(gcd, arg));
        }        
    }

}

cant seem to get this to work any suggestions on where i could place this Thanks

Use \times for multiplication instead of *
Source Link
mjolka
  • 16.2k
  • 2
  • 29
  • 73

\$\dfrac{3}{4} * \dfrac{8}{15}\$\$\dfrac{3}{4} \times \dfrac{8}{15}\$ and the output would be \$\dfrac{2}{5}\$.

\$\dfrac{3}{4} * \dfrac{8}{15}\$ and the output would be \$\dfrac{2}{5}\$.

\$\dfrac{3}{4} \times \dfrac{8}{15}\$ and the output would be \$\dfrac{2}{5}\$.

deleted 28 characters in body; edited title
Source Link
Jamal
  • 34.9k
  • 13
  • 133
  • 237
Loading
Source Link
Loading