0

Write a program that prompts the user to input two numbers, a numerator and a divisor. Your program should then divide the numerator by the divisor, and display the quotient and remainder.

So far I have this....

numerator = int(input("Enter your numerator: "))
divisor = int(input("Enter your divisor: "))

print(numerator%divisor)

*How do you get the quotient and the remainder to display???

Roshin Raphel
  • 2,612
  • 4
  • 22
  • 40

2 Answers2

0
num = int(input("Enter Numerator "))
den = int(input("Enter Denominator "))
quotient=int(num/den)
modulus=int(num%den)

print(quotient, modulus)
SamTheProgrammer
  • 1,051
  • 1
  • 10
  • 28
  • Welcome to Stack Overflow. Code is a lot more helpful when it is accompanied by an explanation. Stack Overflow is about learning, not providing snippets to blindly copy and paste. This is particularly important when answering old questions (this one is three years old). Please [edit] your answer and explain how it answers the specific question being asked. See [answer]. – ChrisGPT was on strike Oct 16 '22 at 15:39
-2
num=int(input("Enter a number"))
den=int(input("Enter another number"))
print("The answer is " + str(num//den) + " R " + str(num%den))
deadshot
  • 8,881
  • 4
  • 20
  • 39
Rohan
  • 1