Pass by Value

During pass by value, value in called function is not modified.

Example

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void SumVals(int vals)
        {
            Console.WriteLine("Before modification {0}",vals);
            vals += 10;
        }
        static void Main(string[] args)
        {
            int passValue = 20;
            SumVals(passValue);
            
            Console.WriteLine("After modification {0}",passValue);
            Console.ReadKey();
        }
    }
}