#include<bits/stdc++.h>
using namespace std;
int primitive_Prime(int p)
{
int r = 1, i;
for(i=2;i<p;i++)
{
if(__gcd(i, p)==1)
r++;
}
return r;
}
int main()
{
int p;
cout << "Enter A Prime Number :: ";
cin >> p;
int d = primitive_Prime(p-1);
cout << d << endl;
return 0;
}
using namespace std;
int primitive_Prime(int p)
{
int r = 1, i;
for(i=2;i<p;i++)
{
if(__gcd(i, p)==1)
r++;
}
return r;
}
int main()
{
int p;
cout << "Enter A Prime Number :: ";
cin >> p;
int d = primitive_Prime(p-1);
cout << d << endl;
return 0;
}
Comments
Post a Comment