#include <stdio.h>
#include <conio.h>
void swap(int *x,int *y)
{
int temp;
temp = *x;
*x=*y;
*y=temp;
printf("swapped values are a= %d and b = %d",*x,*y);
}
void main()
{
int a = 7, b = 4;
swap(&a,&b);
printf("Original values are a= %d and b = %d",a,b);
printf("The values after swap are a = %d,b = %d",a,b);
getch();
}
No comments:
Post a Comment