Friday, April 17, 2009

FUNREF

#include
void main()
{
int num1,num2;
int inter_change(int *n1,int *n2);
printf("Enter two nos\n");
scanf("%d%d",&num1,&num2);
printf("Before calling function\n");
printf("num1=%d num2=%d \n",num1,num2);
inter_change(&num1,&num2);
printf("After function is called\n");
printf("num1=%d num2=%d\n",num1,num2);
}
int inter_change(int *n1, int *n2)
{
int temp;
temp=*n1;
*n1=*n2;
*n2=temp;
return 0;
}

No comments: