P012.c (454B)
1 /* 2 * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 3 * Repo: https://github.com/notamitgamer/bsc 4 * License: MIT 5 */ 6 7 /* WAP to swap two integer variable without 8 using third variable */ 9 // using Approch Mode : simple, slow, time consuming 10 11 #include<stdio.h> 12 int main() { 13 int a = 4, b = 6; 14 printf("Before Swap : A = %d, B = %d", a, b); 15 a = a + b; 16 b = a - b; 17 a = a - b; 18 printf("\nAfter Swap : A = %d, B = %d", a, b); 19 return 0; 20 }