I need to modify the program so that will show the number of transformation that are made.
Example:
if i enter 712 it gave me the transformed number witch is 1, but i want to show me the number of transformation to, witch is 3.
712->10->1.
Code:#include <stdio.h> int main() { int input; printf ("Enter a number \n "); scanf ("%d", &input); int digit = 0; while (1) { if ( (input % 10 > 0) || (input /10 > 0) ) { digit += input % 10; input /= 10; } else if ( digit > 9 ) { input = digit; digit = 0; } else { break; } } printf("Your input is condensed to %d \n\n", digit); return 0; }