×

# [closed] problem in submitting answer for small factorials

 0 /*my code for small factorial progtam*/ #include double FACT(int n) ; int main() { int X,i=0; int NUM[100]; scanf("%d",&X); if((1<=X)&&(X<=100)){ while(i

### The question has been closed for the following reason "Duplicate Question - http://discuss.codechef.com/questions/21083/problem-in-submitting-answer-for-small-factorials" by betlista 15 Aug '13, 13:38

 0 I used your code to calculate 100! Here is the output. Compare it with the correct answer here. Obviously, your answer is wrong. It is because of the precision issues of double. The range of values stored in a double is much higher. But, the result will be correct only in the higher order digits. answered 15 Aug '13, 12:07 4.2k●5●23●64 accept rate: 15% You need to use, what are known as "big integers" for this problem. Please read the tutorial on how to solve this problem here. (15 Aug '13, 12:09)

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:

×46
×33

question asked: 15 Aug '13, 11:54

question was seen: 543 times

last updated: 15 Aug '13, 13:38