How to remove segmentation fault from my code

#include
using namespace std;
#define ll long long int

void dectooct( int n)
{
int r;

ll a[130000000];
int end=0;
while(n!=0)
{
	r=n%8;
	a[end]=r;
	end++;
	n=n/8;
}
for(int i=end-1;i>=0;i--){
 cout<<a[i];
}

}

int main()
{
int n;
cin>>n;
dectooct(n);
return 0;
}

hello @Senjuti256
u r getting segementation fault because u have declared a very big size array , due to which ur programming is consuming too much memory.

i think 100 size array will be sufficient for this problem.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.