I wrote this code but the output coming is wrong .Can you please explain where I am getting wrong ?
#include
using namespace std;
int main() {
int n;
int m=0;
int k;
int p=1;
int g=0;
cin>>n;
while (n>0)
{
k=n%8;
p=10^g;
m=m+k*p;
g=g+1;
n=n/8;
}
cout<<m<<endl;
return 0;
}