- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP

- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who

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.

- Related Questions & Answers
- 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?
- Program to find Quotient and Remainder in Java
- C++ Program for quotient and remainder of big number
- 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
- Print all odd numbers and their sum from 1 to n in PL/SQL
- Finding two numbers given their sum and Highest Common Factor using JavaScript
- Print numbers with digits 0 and 1 only such that their sum is N in C Program.

Advertisements