I want to know if parameter b was provided by the calling method or not so that I can condition it within the definition of method according to it. As there is always a default value of "b" here 0 but I want to distinguish between user calling cc(5,0) and cc(5).
Is there any way to know it?
class Program
{
static void Main(string[] args)
{
var c= cc(5);
}
public static int cc(int a, [Optional] int b)
{
int c=0;
//if(b is provided)
c = a * b;
//else()
c =a*a;
return c;
}
}