# Thread: Basic Factorial from 1-10

1. no biggie. Just making sure.

2. ItsMe and FillYourBrain: Thanks a ton for your help. I really appreciate it. I'm going to look at these examples and apply them to my exercise. Again, sorry for my stubborness. I'm still a rookie at this. I appreciate the patience.

Cheers!

3. Hey, wow! I'm learning factorials too! That was an awesome factorial program!

How does the *= work?

Thanks!

mw

4. x *= y is short hand for x = x * y
Same rule applies to += -= /= %= ^= &= etc

5. ## fine

fine I guess I should have given more explaination 2 my code :P
ok I assumed that the user would want to tell the program which numbers it wants it to find the factorial to :P

Code:
```int i  , sum = 1 ;

printf("Enter value");
scanf("%d" , & value );

for ( i = value ; i  > 0 ; i-- )
sum = sum * i ;

printf("The result is % d \n" , sum );```
so if the user enters 5 for example it would resul in
5 * 4 * 3 * 2 * 1 = 120 :P
sorrry if i caused loads of cunfusion !! :P:P:P:P

6. ## oh yeah

Also forgot to declaure value as int :P
Code:
```

int main()
{
int i , value , sum = 1 ;

printf("Enter value");
scanf("%d" , & value );

for ( i = value ; i  > 1 ; i-- )
sum = sum * i ;

printf("The result is % d \n" , sum );

return(0);
}```