- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Python Program to Read Two Numbers and Print Their Quotient and Remainder
When it is required to read two numbers and print the quotient and remainder when they are divided, the ‘//’ and ‘%’ operators can be used.
Below is a demonstration of the same −
first_num = int(input("Enter the first number...")) second_num = int(input("Enter the second number...")) print("The first number is ") print(first_num) print("The second number is ") print(second_num) quotient_val = first_num//second_num remainder_val = first_num%second_num print("The quotient is :") print(quotient_val) print("The remainder is :") print(remainder_val)
Enter the first number...44 Enter the second number...56 The first number is 44 The second number is 56 The quotient is : 0 The remainder is : 44
The first and second numbers are taken as input from the user.
They are displayed on the console.
To find the quotient, the ‘//’ operator is used.
To find the remainder, the ‘%’ operator is used.
The operations output is assigned to two variables respectively.
This is displayed as output on the console.
- Golang Program to Read Two Numbers and Print their Quotient and Remainder
- Java program to compute Remainder and Quotient
- C++ Program to Find Quotient and Remainder
- C Program to Compute Quotient and Remainder?
- Java Program to Compute Quotient and Remainder
- Program to find Quotient and Remainder in Java
- C++ Program for quotient and remainder of big number
- Return element-wise quotient and remainder simultaneously in Python Numpy
- Python Program to Read a Number n and Print the Natural Numbers Summation Pattern
- C# program to accept two integers and return the remainder
- Golang Program to Read a Number (n) and Print the Natural Numbers Summation Pattern
- Python program to print all Happy numbers between 1 and 100
- Java program to print the Armstrong numbers between two numbers
- C program to print array of pointers to strings and their address
- Divide a given scalar element with masked array elements and return arrays with Quotient and Remainder in NumPy