Last active
August 1, 2019 14:46
-
-
Save sachinsaxena25/198e4e063ba56df838a8af1dba7d85b6 to your computer and use it in GitHub Desktop.
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
#include<stdio.h> | |
int main(void){ | |
int x1 = 0; | |
int x2 = 0; | |
printf("please enter the first number:\n"); | |
scanf("%d", &x1); | |
printf("please enter the second number:\n"); | |
scanf("%d", &x2); | |
printf("The numbers before swapping are x1 = %d x2 = %d", x1, x2); | |
x1 = x1 + x2; | |
x2 = x1 - x2; | |
x1 = x1 - x2; | |
printf("Swaped Number are:%d %d", x1, x2); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Edit the printed statement to enter only one variable at a time