Pass int value to a function : Method Parameter : Class C# Examples


C# Examples » Class » Method Parameter »

 

Pass int value to a function









    
using  System;

class  MainClass
{
      public  static  void  Main()  {
            int  SomeInt  =  6;
            
            int  s  =  Sum(5,  SomeInt);
            
            Console.WriteLine(s);                
      }
      public  static  int  Sum(int  x,  int  y)                              //  Declare  the  method.
      {
            return  x  +  y;                                                                    //  Return  the  sum.
      }
      
}
    
   
  
   



Output

11


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Class
» Method Parameter