Remainder Evaluation
Submissions: 2245   Accuracy:

56.77%

  Difficulty: School   Marks: 0
*School Problem's Submission isn't counted in score!

Given two positive integers num1 and num2, the task is to find the remainder when num1 is divided by num2. 

Input:
First line of the input contains an integer T, denoting the number of testcases. Then T test cases follow. Each testcase consists of a single line containing two positive integers num1 and num2 seperated by a space.

Output:
Corresponding to each testcase, print the remainder in a new line.

Constraints:
1 <= T <= 100
0 <= num1 <= 50
1 <= num2 <= 50

Example:
Input:
1
5 3

Output:
2

Explanation:
Testcase 1:
The remainder after dividing 5 by 3 is: 2.

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: Aditya Garg
Author: Aditya Garg 1


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.


to report an issue on this page.