In this program, we will create three variables and initialize them with rational numbers. Then we will get the denominator from a rational number using the denominator() library function.
In the above program, we created three variables num1, num2, num3 and initialized them with rational numbers. Then we got the denominator from the given rational number using the Rational() library function and printed the result.
Program/Source Code:
The source code to get the denominator from a rational number is given below. The given program is compiled and executed successfully.
Output:
Explanation:
In the above program, we created three variables num1, num2, num3 and initialized them with rational numbers. Then we got the denominator from the given rational number using the Rational() library function and printed the result.
need an explanation for this answer? contact us directly to get an explanation for this answer