Python Program to Compute Quotient and Remainder

Find quotient and remainder

Python program to compute quotient and remainder has been shown here. Find here the algorithm, pseudocode and time complexity of the program. The flowchart of the problem can be found here.






1. Python Program & output to Compute Quotient and Remainder

Code has been copied
#**********************************************
#        Alphabetacoder.com
#Python program to compute quotient and remainder
#**********************************************

#initialize two variables
a=17
b=5

#find the quotient
q=int(a/b)
#find the remainder
r=a%b
        
print("When ",a," is divided by ",b,", quotient is ",q," and remainder is ",r,".")

Output


When 17 is divided by 5, quotient is 3 and remainder is 2.