Created
January 26, 2019 07:56
-
-
Save sayantanHack/541b56765d76c909b8c34c394e87909c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/****************************************************************************** | |
Online C Compiler. | |
Code, Compile, Run and Debug C program online. | |
Write your code in this editor and press "Run" button to compile and execute it. | |
***************************SWAP WITHOUT THIRD VARIABLE********************************/ | |
#include <stdio.h> | |
int main() | |
{ | |
int i,j; | |
printf("Enter the i: "); | |
scanf("%d",&i); | |
printf("Enter the j: "); | |
scanf("%d",&j); | |
i=i-j; | |
j=i+j; | |
i = j-i; | |
printf("i: %d\n",i); | |
printf("j: %d\n",j); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment