Monday, 23 February 2015

Call By Reference in C


#include<stdio.h>
#include<conio.h>
main()
{
int a=10,b=20;
clrscr();
swap(&a,&b);
printf("\n A Value is :%d",a);
printf("\n B Value is :%d",b);
getch();
}
swap(int *a,int *b)
{
int *t;
*t=*a;
*a=*b;
*b=*t;
}

No comments:

Post a Comment