@Ankit: Try this:

x = 0;
for( i = N ; i > 0 ; --i )
    x = (i * x + i) % n;

Dave

On Dec 8, 7:19 am, ankit sablok <ankit4...@gmail.com> wrote:
> Q) can anyboy find me the solution to this problem
>
> Given an integer N and an another integer n we have to write a program
> to find the remainder of the following problems
> (1! + 2! + 3! + 4! + ..................... + N!)mod(n)
>
> N<=1000000
> n<=1000;
>
> please help me write a program for this problem
> thanx in advance

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to