write code for Factorial?

Answer Posted / dilip tekedil

public long Factorial(short num)
{
if (num == 1) return (long)1;
return num * Factorial(--num);
}

Is This Answer Correct ?    4 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

In languages without exception-handling facilities, we could send an error-handling procedure as a parameter to each procedure that can detect errors that must be handled. What disadvantages are there to this method?

602


Define satellite Assembly?

558


What are the types of comments in c#?

548


What is difference between dictionary and list in c#?

456


What are native methods?

488






Is a games console a computer?

483


What is a partial method?

499


What is writeline?

485


Is c# a strongly-typed language?

551


What is the use of constructor in c# with example?

434


What is typeof undefined?

508


C# called c sharp why?

556


Define an assembly in .net?

529


Explain the different types of delegates used in c#.

514


What does console writeline do?

494