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; +}