Local Constants : Const : Class C# Examples


C# Examples » Class » Const »

 

Local Constants









    
using  System;

class  MainClass
{
      static  void  Main()
      {
            const  double  PI  =  3.1416;
            double  area  =  2  *  2  *  PI;
            
            Console.WriteLine("Radius:  {0},  Area:  {1}",  2,  area);
      }
}
    
   
  
   



Output

Radius: 2, Area: 12.5664


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Class
» Const