12345678910111213141516171819202122232425262728293031323334353637
#include<iostream> using namespace std; int main() { int a,b,n,s,c,i,l; c=0; int arr[10]; cout<<"enter the values of a"; cin>>a; cout<<"b"; cin>>b; cout<<"n"; cin>>n; for(i=0;i<10;i++) { while(b!=0){ arr[i]=b%2; b=b/2; c++;} } s=1; for(i=0;i<c;i++) { if(arr[i]==1) s=(s*(a^(2^i)))%n; } cout<<s<<endl; cin>>l; return 0; }