Created
April 23, 2022 05:37
-
-
Save Ajinkgupta/e1097d78e820c139918b828d4bc35ec4 to your computer and use it in GitHub Desktop.
Swapping of two numbers c code
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
//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