Click here to Skip to main content
15,891,431 members
Home / Discussions / C#
   

C#

 
GeneralRe: C# access a file Pin
classy_dog17-Sep-12 17:02
classy_dog17-Sep-12 17:02 
GeneralRe: C# access a file Pin
Pete O'Hanlon17-Sep-12 22:05
mvePete O'Hanlon17-Sep-12 22:05 
AnswerRe: C# access a file Pin
PIEBALDconsult17-Sep-12 17:00
mvePIEBALDconsult17-Sep-12 17:00 
QuestionInternal connection fatal error!! why?!! Pin
Jassim Rahma17-Sep-12 5:12
Jassim Rahma17-Sep-12 5:12 
AnswerRe: Internal connection fatal error!! why?!! PinPopular
Pete O'Hanlon17-Sep-12 6:09
mvePete O'Hanlon17-Sep-12 6:09 
GeneralRe: Internal connection fatal error!! why?!! Pin
Andrei Straut17-Sep-12 6:14
Andrei Straut17-Sep-12 6:14 
AnswerRe: Internal connection fatal error!! why?!! Pin
Emmanuel Medina17-Sep-12 7:43
professionalEmmanuel Medina17-Sep-12 7:43 
GeneralRe: Internal connection fatal error!! why?!! Pin
Jassim Rahma17-Sep-12 7:56
Jassim Rahma17-Sep-12 7:56 
GeneralRe: Internal connection fatal error!! why?!! Pin
Emmanuel Medina17-Sep-12 8:12
professionalEmmanuel Medina17-Sep-12 8:12 
GeneralRe: Internal connection fatal error!! why?!! Pin
Jassim Rahma17-Sep-12 8:18
Jassim Rahma17-Sep-12 8:18 
GeneralRe: Internal connection fatal error!! why?!! Pin
Andrei Straut17-Sep-12 8:25
Andrei Straut17-Sep-12 8:25 
GeneralRe: Internal connection fatal error!! why?!! Pin
PIEBALDconsult17-Sep-12 8:42
mvePIEBALDconsult17-Sep-12 8:42 
AnswerRe: Internal connection fatal error!! why?!! Pin
PIEBALDconsult17-Sep-12 8:39
mvePIEBALDconsult17-Sep-12 8:39 
AnswerRe: Internal connection fatal error!! why?!! Pin
jschell17-Sep-12 8:43
jschell17-Sep-12 8:43 
AnswerRe: Internal connection fatal error!! why?!! Pin
Pete O'Hanlon17-Sep-12 9:33
mvePete O'Hanlon17-Sep-12 9:33 
GeneralRe: Internal connection fatal error!! why?!! Pin
Jassim Rahma17-Sep-12 9:59
Jassim Rahma17-Sep-12 9:59 
GeneralRe: Internal connection fatal error!! why?!! Pin
Emmanuel Medina17-Sep-12 10:13
professionalEmmanuel Medina17-Sep-12 10:13 
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.

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.