#include"stdio.h"
#include"conio.h"
void swap(int *x, int *y);
void main()
{
int a=5,b=8;
printf("value of a before function =%d",a);
printf("value of b before function =%d",b);
swap(a,b);
printf("value after function a=%d \t b=%d",a,b);
getch();
}
void swap(int *x, int *y);
{
int temp;
temp=x;
x=y;
y=temp;
printf("value of a =%d",*x);
printf("value of b =%d",*y);
}
No comments:
Post a Comment