Pass integer value by value : Method Parameter : Class C# Examples


C# Examples » Class » Method Parameter »

 

Pass integer value by value









    
using  System;

class  MainClass
{
    static  void  Main(string[]  args)
    {
            int  MyInt  =  5;

        MyMethod(  MyInt);
      
                Console.WriteLine(MyInt);
    }
    
    static  public  int  MyMethod(  int  myInt)
    {
        myInt  =  myInt  +  myInt;
        return  myInt;
    }
}
    
   
  
   



Output

5


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Class
» Method Parameter