Exercise 13
Write a program program which asks the user to enter two integers 'a' and 'b' and display the quotient and the remainder of the Euclidean division of 'a' by 'b'.
Solution
1 2 3 4 5 6 7 |
# Ask user to enter the values of a and b a = int(input("Type the value of the integer a: ")) b = int(input("Type the value of integer b: ")) q = a//b r = a%b print("The quotient of the Euclidean division of a by b is: q = ", q) print("The remainder of the Euclidean division of a by b is: r = ", r) |
Younes Derfoufi
CRMEF OUJDA
1 thought on “Solution Exercise 13: Quotient and remainder of Euclidean division of a by b”