I assume numerator and denominator will be in two different variables, Just divide both of them by the greatest common factor.
Here is a method to calculate the greatest common factor; it is based on the fact that, for example, the greatest common factor of 14 and 10 is the same as the greatest common factor of 10 and 4, where 4 is calculated as 14 - 10 (or faster, to avoid repeated subtractions, 14 % 10).
public static void main(String[] args) {
System.out.println(gcf(300L, 200L));
}
static long gcf(long a, long b)
{
long c;
while (true)
{
c = a % b;
if (c == 0) break;
a = b;
b = c;
}
return b;
}
write a c++ program to convert binary number to decimal number by using while statement
write a program that reads a phrase and prints the number of lowercase latters in it using a function for counting? in C program
how to write a program that counts automorphic number from 1 to 999
To write a C program to determine if something is odd or even you need to be a programmer. To write a program in C is complicate and only done by programmers.
12
Not too tough . . . Any number that you can completely write down on paperis a rational number.
0.2 is a rational number in and of itself.
rational. The fact that you could write it out in a fraction proves that it is.
Any number that you can write down completely is a rational number. You did that with 89.99, so it's rational.
6 is a rational number. It can be written as 6/1
All integers are rational numbers so the answer is 721.
8,100 is the ratio of 8,100 to 1 . That's about as rational as you can get.The definition of a rational number is:A number that you can write as the ratio of two whole numbers.It also turns out that if you can write a number out completely with digits,then it's a rational number.
Write each rational number as b. 0.31
Answer: 1 already is a rational number. If you want to get technical, you could write it as 1/1. Answer: Any integer is a rational number. No matter how you write it, it will still be a rational number. Answer: 10/10, 2/2, 3/3, 365/365, etc.
Rational
Being rational or irrational is not about "predicting the next digit"; the definition of a rational number is that you can write it as a fraction, with integer numerator and denominator.Being rational or irrational is not about "predicting the next digit"; the definition of a rational number is that you can write it as a fraction, with integer numerator and denominator.Being rational or irrational is not about "predicting the next digit"; the definition of a rational number is that you can write it as a fraction, with integer numerator and denominator.Being rational or irrational is not about "predicting the next digit"; the definition of a rational number is that you can write it as a fraction, with integer numerator and denominator.
12.52 is rational, as is any number that you can write out completely in decimal form.