Write a program that takes in any fraction (numerator and denominator). The program should then output the equivalent decimal number (with decimal point values) AND the equivalent mixed number (whole number AND fraction portions).
Sample run:
Enter a numerator: 5
Enter a denominator: 4
Decimal: 1.25
Mixed Number: 1 and 1 / 4
Answers
Answered by
0
Answer:
num = int(input("Enter a Numerator: "))
den = int(input("Enter a Denominator: "))
print("Decimal: ", num/den)
print("Mixed Number: ", num//den, "and", str(num%den)+"/"+str(den))
Explanation:
Similar questions
Chemistry,
3 months ago
Computer Science,
7 months ago
Hindi,
7 months ago
English,
1 year ago
Math,
1 year ago