diff --git a/modularExponentiation.cpp b/modularExponentiation.cpp index d30e50b..c02f7bb 100644 --- a/modularExponentiation.cpp +++ b/modularExponentiation.cpp @@ -1,9 +1,13 @@ +/*Author: Sahil Kalamkar + *Date: 13/10/2019 + */ #include using namespace std; typedef long long ll; const int mod = 1e9+7; +//Function to calculate a raised to the power of b modulo m for large values. ll modularExponentiation(ll base,ll exponent,ll modulo) { if(exponent==0) @@ -20,10 +24,10 @@ ll modularExponentiation(ll base,ll exponent,ll modulo) } int main() -{ +{ + //Input Format: 3 integers denoting the base,the power and the integer with which you want the remainder. int base,power,m; cin>>base>>power>>m; - cout<