Question: #include int shift _ digits ( int n , int numlocation ) { if ( n = = 0 ) { return 0 ; }

#include
int shift_digits(int n, int numlocation){
if (n ==0){
return 0;
}
int currentnum = n %10 ;
int changednum ;
if (currentnum !=9){
changednum = currentnum +1;
}
else {
changednum = currentnum;
}
int result = changednum + numlocation;
int recursivenum = shift_digits(n/10, numlocation *10);
return result + recursivenum;
}
int main (void){
int n =0;
scanf("%d", &n);
printf("%d
", shift_digits(n,1));
} make it recursive where 0 becomes 1 and 22 become 33 all can be added one except number 9

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!