Click here to Skip to main content
15,881,281 members
Home / Discussions / C#
   

C#

 
QuestionInterprocess Communication from C# to HTML page Pin
vjpudelski17-Sep-12 4:53
vjpudelski17-Sep-12 4:53 
AnswerRe: Interprocess Communication from C# to HTML page Pin
Eddy Vluggen17-Sep-12 7:16
professionalEddy Vluggen17-Sep-12 7:16 
AnswerRe: Interprocess Communication from C# to HTML page Pin
Abhinav S17-Sep-12 7:59
Abhinav S17-Sep-12 7:59 
QuestionOpen Source Alternatives to Word Library and Word Compnents Pin
ASPnoob17-Sep-12 3:29
ASPnoob17-Sep-12 3:29 
AnswerRe: Open Source Alternatives to Word Library and Word Compnents Pin
Andrei Straut17-Sep-12 3:50
Andrei Straut17-Sep-12 3:50 
GeneralRe: Open Source Alternatives to Word Library and Word Compnents Pin
Pete O'Hanlon17-Sep-12 3:55
mvePete O'Hanlon17-Sep-12 3:55 
GeneralRe: Open Source Alternatives to Word Library and Word Compnents Pin
Andrei Straut17-Sep-12 4:08
Andrei Straut17-Sep-12 4:08 
Question[Solved] Problem #20 Pin
WebMaster17-Sep-12 2:10
WebMaster17-Sep-12 2:10 
Hello friends

I am practicing C# by solving the Problems in projecteuler.net. Now I am working on 20th one.

I create a project and here it is my code:
C#
const int number = 100;

double fact = Library.Math.Fact(number);

BigInteger bigInteger = new BigInteger(fact);

int sum = 0;

while (bigInteger > 0)
{
    sum += (int)(bigInteger % 10);

    bigInteger /= 10;
}

Console.WriteLine("Sum of the digits int the number {0}! is {1}", number, sum);

C#
static double Fact(int number)
{
    return number == 1 ? 1 : number * Fact(number - 1);
}


It is absolutely fine, isn't it?
I have tried the small number that I can calculate manually and the result given was correct. But when I give to the site the rsult of my code it doesn't accept the answer.
What's wrong with my code?

modified 18-Sep-12 9:40am.

AnswerRe: Problem #20 Pin
Ingo17-Sep-12 2:29
Ingo17-Sep-12 2:29 
GeneralRe: Problem #20 Pin
WebMaster17-Sep-12 2:42
WebMaster17-Sep-12 2:42 
GeneralRe: Problem #20 Pin
Ingo17-Sep-12 3:05
Ingo17-Sep-12 3:05 
GeneralRe: Problem #20 Pin
Keith Barrow17-Sep-12 2:45
professionalKeith Barrow17-Sep-12 2:45 
AnswerRe: Problem #20 Pin
PIEBALDconsult17-Sep-12 4:25
mvePIEBALDconsult17-Sep-12 4:25 
GeneralRe: Problem #20 Pin
Shameel17-Sep-12 5:09
professionalShameel17-Sep-12 5:09 
GeneralRe: Problem #20 Pin
PIEBALDconsult17-Sep-12 5:37
mvePIEBALDconsult17-Sep-12 5:37 
GeneralRe: Problem #20 Pin
Dave Kreskowiak17-Sep-12 6:16
mveDave Kreskowiak17-Sep-12 6:16 
AnswerRe: Problem #20 Pin
Clifford Nelson17-Sep-12 10:50
Clifford Nelson17-Sep-12 10:50 
AnswerRe: Problem #20 Pin
WebMaster17-Sep-12 11:01
WebMaster17-Sep-12 11:01 
QuestionData Transfer Between Two Thread Pin
sinpulay17-Sep-12 0:12
professionalsinpulay17-Sep-12 0:12 
AnswerRe: Data Transfer Between Two Thread Pin
Manfred Rudolf Bihy17-Sep-12 0:27
professionalManfred Rudolf Bihy17-Sep-12 0:27 
GeneralRe: Data Transfer Between Two Thread Pin
sinpulay19-Oct-12 22:35
professionalsinpulay19-Oct-12 22:35 
Questionhow to ... Pin
john563216-Sep-12 23:16
john563216-Sep-12 23:16 
AnswerRe: how to ... Pin
Mycroft Holmes16-Sep-12 23:37
professionalMycroft Holmes16-Sep-12 23:37 
GeneralRe: how to ... Pin
john563216-Sep-12 23:43
john563216-Sep-12 23:43 
AnswerRe: how to ... Pin
Bernhard Hiller16-Sep-12 23:37
Bernhard Hiller16-Sep-12 23:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.