Skip to content

Instantly share code, notes, and snippets.

@sayantanHack
Created January 26, 2019 07:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sayantanHack/541b56765d76c909b8c34c394e87909c to your computer and use it in GitHub Desktop.
Save sayantanHack/541b56765d76c909b8c34c394e87909c to your computer and use it in GitHub Desktop.
/******************************************************************************
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