In this program, we will create 3 variables and initialize them with the rational number. Then we will use the numerator() function to get numerator from rational numbers.
In the above program, we created three variables and initialized them with the rational number. Then we used the numerator() function to get the numerator from rational numbers and printed the result.
Program/Source Code:
The source code to get the numerator 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 and initialized them with the rational number. Then we used the numerator() function to get the numerator from rational numbers and printed the result.
need an explanation for this answer? contact us directly to get an explanation for this answer