What is the difference between method parameters and method arguments? Give an example?

 Posted by Tripati_tutu on 11/16/2010 | Category: C# Interview questions | Views: 2163 | Points: 40

The method parameters are passed as an argument for a method but the method arguments are itself having a value. The method definition specifies the name and type of any parameters that are required. The arguments must be compatible with the parameter type but the argument name used in the calling code does not have to be the same as the parameter named defined in the method.
In the below example FNum and SNum are method parameters and N1 and N2 are method arguments.

using System;

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

namespace Sample
class Program
public static void Main()
int N1 = 10;
int N2 = 20;
//N1 and N2 are method arguments
int Total = Sum(N1, N2);

//FNum and SNum are method parameters
public static int Sum(int FNum, int SNum)
int Sum = FNum + SNum;
return Sum;

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response