# Thread: Help with the program

1. ## Help with the program

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;
}```

2. So you're saying that each time the loop runs you want to ... count? I wonder how you could do that.

Quzah.

3. it must be a simple thing to do it but i don't know how. the first operation is entering the number second and third are the calculations but i don't know how to write it to show me that.

4. Yeah, "simple" because you just copy/pasted your code from C program for condensing the given numbers into a single number

I mean, if you has actually written any code yourself, and understood what say line 13 was doing, then writing something to add 1 to a counter would be so damn obvious it wouldn't even need to be asked.

Just drop the course already, if this is your entire plan for getting through the course.

If you've been copy/pasting homework up to now, you may as well just drop it now - you're already too far behind to make up the lost ground.

You have absolutely no idea how much harder this is going to get.

5. its just my second week on a course and only 5th class .and i tried with incrementing the counter but it didn't work. and thanks for showing me from where my college knew it how to write the program and he was saying that he wrote it by himself.

6. > where my college knew it how to write the program and he was saying that he wrote it by himself.
Great, so your tutor is copy/pasting code from the web as well.