I encountered a problem the code for which is -
int* plusOne(int* A, int n1)
{
int i=1;
while((A[n1-i]+1==10)&&(i<n1))
{
A[n1-i]=0;
i++;
}
A[n1-i]++;
for(i=0;i<n1;i++)
{
printf("%d",A[i]);
}
}
Only later I read that they want me to give output by using return statements. I searched for the solution and found Returning an array using C on Stack Overflow, but I'm not able to understand it — please help.