#include<stdio.h>
int swap(int*,int*);
void main()
{
int a,b;
printf("Enter a:\t");
scanf("%d",&a);
printf("Enter b:\t");
scanf("%d",&b);
printf("Entered value of\n'a' is:%d \n 'b' is: %d",a,b);
swap(&a,&b);
printf("value after swaping ....\n a=%d\n b=%d",a,b);
}
int swap(int*a,int*b)
{
int temp;
temp=*a;
*a=*b;
*b=temp;
}
0 Comments