Find Remainder
All submissions for this problem are available.
Write a program to find the remainder when two given numbers are divided.Input
The first line contains an integer T, total number of test cases. Then follow T lines, each line contains two Integers A and B.Output
Find remainder when A is divided by B.Constraints
- 1 ≤ T ≤ 1000
- 1 ≤ A,B ≤ 10000
Example
Input 3 1 2 100 200 10 40 Output 1 100 10
Solutions
#include <stdio.h>- int main() {
- // Read the number of test cases.
- int T;
- while (T--) {
- // Read the input a, b
- int a, b;
- // Compute the ans.
- // Complete this line.
- int ans =a%b;
- }
- return 0;
- }
Sunday, 11 March 2018
Find Remainder
Subscribe to:
Post Comments (Atom)
Reverse The Number
Reverse The Number All submissions for this problem are available. If an Integer N , write a program to reverse the given number. ...
-
Reverse The Number All submissions for this problem are available. If an Integer N , write a program to reverse the given number. ...
-
The Lead Game All submissions for this problem are available. The game of billiards involves two players knocking 3 balls around on a ...
-
First and Last Digit All submissions for this problem are available. If Give an integer N . Write a program to obtain the sum of t...
No comments:
Post a Comment