diff --git a/C++/power.cpp b/C++/power.cpp new file mode 100644 index 00000000..2dfa8b23 --- /dev/null +++ b/C++/power.cpp @@ -0,0 +1,22 @@ +#include +#define int long long + +int power(int a, int b) { + a %= mod; + int res = 1; + while (b > 0) { + if (b % 2) { + res *= a; + res %= mod; + } + a *= a; + a %= mod; + b /= 2; + } + return res; +} + +signed main() { + cout< Place: Indonesia
About: BACKEND Developer
+Name: [Sandesh Dinkar](https://github.com/SldinkarGECA)
+Place: India
+About: IT student
+