help with homework

Started by omahne, April 17, 2004, 03:46:12 PM

Previous topic - Next topic

need help with assignment

imple
0 (0%)

Total Members Voted: 0

ok, i need help.  i have to submit a homework assignment, beginner, and i am clueless.  i need to write a program that uses for structure to evaluate the factorials of the integars from 1 to 5.  please help.  failing!!!

Define 'for structure' ?

Do you mean 'for loop' ?

There is a difference, and I can't see a structure being used in this. I would suggset that you read up on both topics; C (or C++ if you use that instead) and factorials...

a for loop usually has the format of ..

for (initialization of variables; check; increment/next evaluation) {

code

}

The following example will print out a number, 0 through 5, on a seperate line each ...

int i;

for (i = 0; i < 6; i++)
{
printf("I is now %d", i);
}

You could use a very similar for loop if you're on about a number 1 - 5.. just modify it to your liking.

That's about all I have energy to explain though ...

BTW: You need to read _and_ experiment. If you rely on others, you won't get anywhere ....

Met
"My Terminal is my Soul"

SMF spam blocked by CleanTalk