C Program - Call by Value
#include <stdio.h>
#include <conio.h>
void call_by_value(int x)
{
printf("Inside call_by_value x = %d before adding 10.\n", x);
x += 10;
printf("Inside call_by_value x = %d after adding 10.\n", x);
}
int main()
{
int a=10;
printf("a = %d before function call_by_value.\n", a);
call_by_value(a);
printf("a = %d after function call_by_value.\n", a);
getch();
return 0;
}
Output
-------------
Comments
Post a Comment