Chewbacca and number #showing me no output also didnt und this line---->nt digit = a[i] -'0'

#include

using namespace std;

int main()
{
char a[50];
cin>>a;

int i = 0;
if(a[i] == ‘9’){
i++;
}

//iterate over the remaining chars

for( ;a[i]!=’\0’; i++){

int digit = a[i] -'0'; //convert my char into int digit

if (digit>=5){
	digit = 9 - digit;
	a[i] = digit + '0';
}

return 0;

}
cout<<a<<endl;
}

Hey, you made a mistake writereturn 0; statement after cout<<a<<endl; statement otherwise your code will return from the for loop’s first iteration only.