From 35172d2d1212c35e1e5fef1c583d62ddba056705 Mon Sep 17 00:00:00 2001 From: umang0503 <56040554+umang0503@users.noreply.github.com> Date: Tue, 1 Oct 2019 22:53:08 +0530 Subject: [PATCH] Create swap.c --- swap.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 swap.c diff --git a/swap.c b/swap.c new file mode 100644 index 0000000..c2b9e2a --- /dev/null +++ b/swap.c @@ -0,0 +1,19 @@ +#include + +int main() +{ + int x, y, t; + + printf("Enter two integers\n"); + scanf("%d%d", &x, &y); + + printf("Before Swapping\nFirst integer = %d\nSecond integer = %d\n", x, y); + + t = x; + x = y; + y = t; + + printf("After Swapping\nFirst integer = %d\nSecond integer = %d\n", x, y); + + return 0; +}