Skip to content

Commit 31bff73

Browse files
Merge pull request seeditsolution#41 from Palash-khangar/master
Create Swapping Two Numbers
2 parents 4779fed + c5c702e commit 31bff73

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

Swapping Two Numbers

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#include<stdio.h>
2+
#include<conio.h>
3+
void main()
4+
{
5+
int a;
6+
int b;
7+
printf("Enter First Number");
8+
scanf("%d",&a);
9+
printf("Enter Second Number");
10+
scanf("%d",&b);
11+
printf("Before Swapping");
12+
printf("Value of a is",a);
13+
printf("Value of b is",b);
14+
printf("After Swapping");
15+
a=a+b;
16+
b=a-b;
17+
a=a-b;
18+
printf("Value of a is",a);
19+
printf("Value of b is",b);
20+
return 0;
21+
}

0 commit comments

Comments
 (0)