Search found 1 match

by octaviang
Mon Feb 23, 2009 4:45 pm
Forum: Volume 114 (11400-11499)
Topic: 11476 - Factorizing Large Integers
Replies: 17
Views: 12664

Re: 11476 - Factorizing Large Integers

I have an idea. What if you try recursivity? Just like in math, when we use recurrent functions, we can apply the formulas also here:
We' ll use n!=(n-1)!*n, for any natural number n >=1.

#include <iostream.h>
int factorial(n)
{
if(n==1)
return 1;
else return factorial(n-1) * n;
}
main()
{
cout<<"n ...

Go to advanced search