Recursion Count : Method Recursion : Class C# Examples


C# Examples » Class » Method Recursion »

 

Recursion Count









    
using  System;

class  MainClass
{
      public  static  void  Count(int  InVal)
      {
            if  (InVal  ==  0)
                  return;
            Count(InVal  -  1);

            Console.WriteLine("{0}  ",  InVal);
      }

      public  static  void  Main()
      {
            Count(3);
      }
}
    
   
  
   



Output

1
2
3


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Class
» Method Recursion