#include <stdio.h>
int main() {
char a,b,temp;
char *ptr1, *ptr2;
printf("Enter the values of a and b: \n");
scanf("%c %c",&a, &b);
printf("Before swapping a= %c and b=%c\n",a,b);
ptr1=&a;
ptr2=&b;
temp= *ptr1;
*ptr1= *ptr2;
*ptr2= temp;
printf("After swapping a is %c and b is %c", a ,b);
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: