Advertisement
jezzye13

Scenario 1-2 Flowchart

Aug 18th, 2016
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.76 KB | None | 0 0
  1. //Rextester.Program.Main is the entry point for your code. Don't change it.
  2. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5
  3.  
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using System.Text.RegularExpressions;
  8.  
  9. namespace Rextester
  10. {
  11.     public class Program
  12.     {
  13.        
  14.         public static void Main(string[] args)
  15.         {
  16.             //Your code goes here
  17.             Console.WriteLine("Hello, world!");
  18.            
  19.             int input = 5;
  20.             Console.WriteLine(fact(input));
  21.         }
  22.        
  23.         public static int fact(int n) {
  24.             if (n > 1) {
  25.                 return n * fact(n - 1);
  26.             } else {
  27.                 return n;
  28.             }
  29.         }
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement