APC-PRAC-009.c
Problem Statement
APC-PRAC-009.c
WAP to swap two integer variable without using Third variable.
Source Code
c
#include <stdio.h>
int main()
{
int a = 4, b = 6;
printf("Before swap : A = %d and B = %d", a, b);
a = a ^ b;
b = a ^ b;
a = a ^ b;
printf("\nAfter swap : A = %d and B = %d", a, b);
return 0;
}1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11
● Author - Amit Dutta · Updated - 12 Dec 2025