Oh ok, too bad you didn't mention that minor detail from the start. Sometimes we ask
Originally Posted by jjzarabi
people, if they want help that it would be much easier for us to read your code if you
could use indentation. Just in case you don't know what that means, I made your code
(with 2 corrections) more readable by indenting your code.
What was my reward? Well, I got output alright, but I don't think it is your desired
The two corrections: (In Green) you declared an int i inside a for loop so I moved it with the
other int declarations. Second, I took msh's suggestion, and used " i <= end " because
that makes sense without additional detail.
int main ()
int i, start, end, fact=0;
printf("Please enter a starting and larger ending integer so \n "
"I can find the factorial of each of those integer numbers between and including \n"
"the starting and ending integer numbers which are divisible by 2 as well as by 3\n\n");
for (i=start; i <= end; i++)
if(i%2 && i%3 == 0)
You wanted output? Well, there ya go!
Here was my input: 1 100
Here was my output: -10-10-10-10-10-10-10-10-1