Code:
/*
* C++ Program to Implement Euler Theorem
*/
#include iostream
#include vector
using namespace std;
vector
{
vector
modInverse[1] = 1;
for (int i = 2; i <= n; i++)
{
modInverse[i] = (-(m / i) * modInverse[m % i]) % m + m;
}
return modInverse;
}
//Main
int main()
{
vector
int a, m;
cout<<"Enter number to find modular multiplicative inverse: ";
cin>>a;
cout<<"Enter Modular Value: ";
cin>>m;
cout<
}
Output:
Enter number to find modular multiplicative inverse: 5
Enter Modular Value: 7
3
------------------
(program exited with code: 1)
Press return to continue
More C++ Programs: