Skip to content

Instantly share code, notes, and snippets.

@Ajinkgupta
Created April 23, 2022 05:37
Show Gist options
  • Save Ajinkgupta/e1097d78e820c139918b828d4bc35ec4 to your computer and use it in GitHub Desktop.
Save Ajinkgupta/e1097d78e820c139918b828d4bc35ec4 to your computer and use it in GitHub Desktop.
Swapping of two numbers c code
//using third variable
#include<stdio.h>
#include<conio.h>
void main ()
{
int a,b,c;
printf("\n\nEnter two numbers : \n");
scanf("%d%d",&a,&b);
printf("Before swapping......\n");
printf("a= %d\n",a);
printf("b= %d\n",b);
c=a;
a=b;
b=c;
printf("After swapping......\n");
printf("a= %d\n",a);
printf("b= %d\n",b);
getch();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment