Asked by
AL MaMun (4 Golds)
Friday, 31 Jul 2020, 04:57 PM
at (Education
Tutorials)
|
|
|
C++ Program for Bigmod : #include<stdio.h> int bigmod(int a, int b, int m) { if(b==0) return 1%m; int x = bigmod(a, b/2, m); x=(x*x)%m; if(b%2==1) x=(x*a)%m; return x; } int main() { int a, b, m, result; scanf("%d%d%d", &a, &b, &m); result=bigmod(a, b, m); printf("Modulus = %d", result); return 0; } |
|
|
|
|
|
|
|
|
|
|