#include<stdio.h>
#include<conio.h>
void main()
{
void swap(int*,int*);
int a,b;
clrscr();
printf("Enter the value of a = ");
scanf("%d",&a);
printf("Enter the value of b = ");
scanf("%d",&b);
swap (&a,&b);
printf("The value of a = %d \nThe value of b = %d",a,b);
getch();
}
void swap(int *a,int *b)
{
int temp;
temp=*a;
*a=*b;
*b=temp;
}
0 Comments:
Post a Comment