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
Science,
2 months ago
English,
2 months ago
Political Science,
2 months ago
Computer Science,
6 months ago
Hindi,
6 months ago
English,
11 months ago
Math,
11 months ago
Biology,
11 months ago