Skip to content

Instantly share code, notes, and snippets.

@w3Abhishek
Created June 13, 2021 06:58
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 w3Abhishek/a9e1ff7f7532699aae4400191d93c708 to your computer and use it in GitHub Desktop.
Save w3Abhishek/a9e1ff7f7532699aae4400191d93c708 to your computer and use it in GitHub Desktop.
#include <stdio.h>
int main()
{
int a, b;
printf("Enter two numbers (a & b) to swap without using third variable:\n");
scanf("%d%d", &a, &b);
/* Program by codewin.org */
a = a + b;
b = a - b;
a = a - b;
printf("Here are the swapped values without using third variable: a = %d\nb = %d\n",a,b);
printf("CodeWin.org - Winning Hearts of Coders!!!");
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment