Click here to Skip to main content
15,921,694 members
Home / Discussions / C#
   

C#

 
QuestionSimple Unzip of zip file containing multiple files and folders [modified] Pin
arun_pk4-Jan-11 19:46
arun_pk4-Jan-11 19:46 
AnswerRe: Simple Unzip of files Pin
Hiren solanki4-Jan-11 19:50
Hiren solanki4-Jan-11 19:50 
GeneralRe: Simple Unzip of files Pin
arun_pk4-Jan-11 19:55
arun_pk4-Jan-11 19:55 
AnswerRe: Simple Unzip of files Pin
Hiren solanki4-Jan-11 19:57
Hiren solanki4-Jan-11 19:57 
GeneralRe: Simple Unzip of files Pin
arun_pk4-Jan-11 19:58
arun_pk4-Jan-11 19:58 
AnswerRe: Simple Unzip of zip file containing multiple files and folders Pin
ManOFTheMatcH4-Jan-11 20:03
ManOFTheMatcH4-Jan-11 20:03 
AnswerRe: Simple Unzip of zip file containing multiple files and folders Pin
RaviRanjanKr4-Jan-11 21:29
professionalRaviRanjanKr4-Jan-11 21:29 
GeneralRe: Simple Unzip of zip file containing multiple files and folders Pin
arun_pk4-Jan-11 22:27
arun_pk4-Jan-11 22:27 
GeneralRe: Simple Unzip of zip file containing multiple files and folders Pin
RaviRanjanKr4-Jan-11 23:37
professionalRaviRanjanKr4-Jan-11 23:37 
QuestionMessage Removed Pin
4-Jan-11 19:34
Sharath Hanakere4-Jan-11 19:34 
AnswerRe: Create a Sitemap User Control by using Recursion Pin
OriginalGriff4-Jan-11 20:36
mveOriginalGriff4-Jan-11 20:36 
GeneralRe: Create a Sitemap User Control by using Recursion Pin
Sharath Hanakere4-Jan-11 20:55
Sharath Hanakere4-Jan-11 20:55 
GeneralRe: Create a Sitemap User Control by using Recursion Pin
OriginalGriff4-Jan-11 20:57
mveOriginalGriff4-Jan-11 20:57 
GeneralMessage Removed Pin
4-Jan-11 22:12
Sharath Hanakere4-Jan-11 22:12 
GeneralRe: Create a Sitemap User Control by using Recursion Pin
OriginalGriff4-Jan-11 22:35
mveOriginalGriff4-Jan-11 22:35 
QuestionRe: Create a Sitemap User Control by using Recursion Pin
JacquesDP5-Jan-11 2:38
JacquesDP5-Jan-11 2:38 
AnswerRe: Create a Sitemap User Control by using Recursion Pin
OriginalGriff5-Jan-11 2:51
mveOriginalGriff5-Jan-11 2:51 
Consider yourself corrected! Laugh | :laugh:
private int Factorial (int n)
   {
   if (n < 0)
      {
      throw new ArgumentException("Factorial not defined for negative numbers");
      }
   if (n == 0)
      {
      return 1;  // Special case : 0! is defined to be one
      }
   return n * Factorial(n - 1);
   }
If you call it with 3:
Factorial(3)
Calls Factorial(3 - 1): Factorial(2)
Calls Factorial(2 - 1): Factorial(1)
Calls Factorial(1 - 1): Factorial(0)
Which returns 1.
You can add another special case @ either 2 or 1, but it looks clumsy for this example. Let's be honest, I wouldn't implement factorial this way in the real world anyway; it is just the classic example and easy to understand what is going on.
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.

GeneralRe: Create a Sitemap User Control by using Recursion Pin
JacquesDP5-Jan-11 2:57
JacquesDP5-Jan-11 2:57 
AnswerRe: Create a Sitemap User Control by using Recursion Pin
Abhinav S4-Jan-11 20:51
Abhinav S4-Jan-11 20:51 
QuestionUsing rdpsign.exe with c sharp and where to get it Pin
turbosupramk34-Jan-11 12:52
turbosupramk34-Jan-11 12:52 
AnswerRe: Using rdpsign.exe with c sharp and where to get it Pin
Dave Kreskowiak4-Jan-11 16:15
mveDave Kreskowiak4-Jan-11 16:15 
GeneralRe: Using rdpsign.exe with c sharp and where to get it [modified] Pin
turbosupramk34-Jan-11 16:41
turbosupramk34-Jan-11 16:41 
QuestionCreate a new additional function to use with Cristal Report (VS2005) Pin
martinergb4-Jan-11 7:02
martinergb4-Jan-11 7:02 
Questiondatagridview cell type Pin
csrss4-Jan-11 6:23
csrss4-Jan-11 6:23 
AnswerRe: datagridview cell type Pin
Dave Kreskowiak4-Jan-11 6:40
mveDave Kreskowiak4-Jan-11 6:40 

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.