Write a program without third variable swap two number in c

 Write a program without third variable swap two number 


Write a program without third variable swap two number

Program 👇👇 Use turbo c/c++

//Write a program without third variable swap two number   

#include<stdio.h>   

#include<conio.h>   

void main()     

{   

     int a=24,b=3;    

     clrscr();   

     printf("\n Without swap A=%d B=%d",a,b);   

     a=a-b;   

     b=a+b;    

     a=b-a;    

     printf("\n Swap A=%d B=%d",a,b);   

getch();  

}  


Output:-





Related Program (Please Check)

1. Basic Question All


Post a Comment

0 Comments