Tuesday 5 March 2013

CALL BY VALUE

#include<stdio.h>
#include<conio.h>
void value(int x, int y);
main( )
{
int a=5, b=8;
printf("Before calling the function, a = %d and b = %d\n", a, b);
value(a, b);
printf("After calling the function, a = %d and b = %d\n", a, b);
getch();
}
void value(int x, int y)
{
x++;
y++;
printf("Inside function x = %d , y = %d\n",x,y);
}

No comments:

Post a Comment