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
- Compute n! under modulo p
- Modulo 10^9+7 (1000000007)
- Maximum subarray sum modulo m
- Sort elements by modulo with K
- Equalizing array using increment under modulo 3
- Find sum of modulo K of first N natural number
- Modulo of a large Binary String
- Maximum modulo of all the pairs of array where arr[i] >= arr[j]
- Sort elements of array whose modulo with K yields P
- Cyclic Redundancy Check and Modulo-2 Division
- Find Square Root under Modulo p | Set 1 (When p is in form of 4*i + 3)
- Sort the given stack elements based on their modulo with K
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.