Given three numbers A, B, and M. The task is to print the sum of A and B under modulo M.
Input: a = 10, b = 20, m = 9 Output: 0 10+20 = 30 % 9 = 0 Input: a = 100, b = 13, m = 107 Output: 6
Approach: Add the two given numbers A and B and print their sum under modulo M.
Below is the implementation of the above approach:
The sum = 0
- LCM of N numbers modulo M
- Modulo power for large numbers represented as strings
- Fibonacci modulo p
- Modulo 10^9+7 (1000000007)
- Compute n! under modulo p
- Maximum subarray sum modulo m
- Sort elements by modulo with K
- Maximum modulo of all the pairs of array where arr[i] >= arr[j]
- Find sum of modulo K of first N natural number
- Equalizing array using increment under modulo 3
- Modulo of a large Binary String
- Sort elements of array whose modulo with K yields P
- Divisibility by 3 where each digit is the sum of all prefix digits modulo 10
- Expressing a fraction as a natural number under modulo 'm'
- Find Square Root under Modulo p | Set 1 (When p is in form of 4*i + 3)
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.