It is giving wrong answer

how can i store large integers in an character array

you can simply take a string and input the number as a string,
Code

#include<bits/stdc++.h>
using namespace std;

void chewbacca(char* a,int i,char* out,int j)
{
if(a[i]==’\0’)
{
out[j]=’\0’;
cout<<out<<endl;
return;
}
int ch=a[i]-‘0’;
int d=abs(9-ch);
if(d<ch)
a[i]=d;
else
a[i]=ch;

chewbacca(a,i+1,out,j+1);
return;

}
int main() {
char a[100];
cin>>a;
char out[100];
chewbacca(a,0,out,0);
return 0;
}

This is what i have done

since you are making changes to a, you need to print a only and you need to change the way you were assigning a[i], instead of a[i] = d,. a[i] = d + ‘0’ would come

Corrected Code

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.