×

# Help needed in CSEQ - April15 Long Challenge

 0 I was trying to understand this solution. But I'm not able to get what does the following code do? long long factorial(int n) { long long res = 1; while (n > 0) { for (int i = 2, m = n % MOD; i <= m; i++) res = (res * i) % MOD; if ((n /= MOD) % 2 > 0) res = MOD - res; } return res; }  Can someone please help? asked 21 Apr '15, 15:45 11●1 accept rate: 0% 0★admin ♦♦ 19.8k●350●498●541
 toggle preview community wiki:
Preview

By Email:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• image?![alt text](/path/img.jpg "title")
• numbered list: 1. Foo 2. Bar
• to add a line break simply add two spaces to where you would like the new line to be.
• basic HTML tags are also supported
• mathemetical formulas in Latex between \$ symbol

Question tags:

×900
×344
×35

question asked: 21 Apr '15, 15:45

question was seen: 1,186 times

last updated: 21 Apr '15, 20:20