I am newbie. So please bear with me,
#include<stdio.h>
int abc(int k)
{
k++;
}
int main()
{
int a=1;
printf("%d",abc(a));
return 0;
}
Output of above program is : 1
My question is shouldn't the output should be '2' as the actual parameter is passing the value of '1' to the formal parameter and it has to be incremented by the function abc.
And when I change the function call to
printf("%d",abc(1));
The output is some garbage value.
How does parameter passing work here? Please explain.