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
- Modulo 10^9+7 (1000000007)
- Compute n! under modulo p
- Fibonacci modulo p
- Maximum subarray sum modulo m
- Maximum modulo of all the pairs of array where arr[i] >= arr[j]
- Equalizing array using increment under modulo 3
- Find sum of modulo K of first N natural number
- Primitive root of a prime number n modulo n
- Divisibility by 3 where each digit is the sum of all prefix digits modulo 10
- Program to find remainder without using modulo or % operator
- Cyclic Redundancy Check and Modulo-2 Division
- Find Square Root under Modulo p | Set 1 (When p is in form of 4*i + 3)
- Exponential Squaring (Fast Modulo Multiplication)
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. 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.