Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions C++/power.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#include <bits/stdc++.h>
#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<<power(3,2)<<endl;
return 0;
}
4 changes: 4 additions & 0 deletions Contributors.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,5 +117,9 @@ Name: [Muhammad Iqbal R](https://github.com/miqbalrr) <br/>
Place: Indonesia <br/>
About: BACKEND Developer <br/>

Name: [Sandesh Dinkar](https://github.com/SldinkarGECA) <br/>
Place: India <br/>
About: IT student <br/>