Computer Science, asked by livieliveliv, 6 months ago

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 Anonymous
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