Your Ad Here

Sunday, December 21, 2008

Call by Values in C

/* Program on interchanging two numbers demonstrating Call By Values in C*/
#include< stdio.h>
#include< conio.h>
void main()
{
int x,y;
x=15;y=20;
clrscr();
printf("x=%d,y=%d\n",x,y);
swap(x,y);
printf("\n after interchanging x=%d,y=%d\n",x,y);
getch();
}
swap(int u,int v)
{
int temp;
temp=u;
u=v;
v=temp;
return;
}

2 comments:

kawaljeet said...

hi , this is not a call by reference ita call by value

kawaljeet said...

hi , bro not a call by reference its call by value

Your Ad Here