Determine the output of following C code segment:
int add (int a, int b=12)
{
return a + b;
}
main()
{
int c;
c = add (10, 20);
printf("c = %d", c);
}
int add (int a, int b=12) // formal argument
{
return a + b;
}
main()
{
int c;
c = add (10, 20);
printf("c = %d", c);
}
In this Program Add function is following the call by value mechanism so that value cannot be called outside the function So the answer will be a+b = 10+ 20 = 30
Therefore Option B is correct

