lankygiant16
Baseband Member
- Messages
- 63
So im taking this C programming class, and im not too great at programming, so im having a tough time. My teacher sucks, he doesnt really explain things very well, so we have to figure a lot stuff out. Im having trouble doing factorials...and yeah.
this is how i first took a stab at it
int i, num, factorial;
for( i=1; i<=num; i++)
{
factorial = num * i;
}
now i know this is wrong...just HOW WRONG am i? and how do i fix it. I also have to do summation meaning like 5+4+3+2+1 as an example....so i figure it will be quite similar. thanks for all the help!!
Jim
this is how i first took a stab at it
int i, num, factorial;
for( i=1; i<=num; i++)
{
factorial = num * i;
}
now i know this is wrong...just HOW WRONG am i? and how do i fix it. I also have to do summation meaning like 5+4+3+2+1 as an example....so i figure it will be quite similar. thanks for all the help!!
Jim