Skip to content

Instantly share code, notes, and snippets.

@sachinsaxena25
Last active August 1, 2019 14:39
Show Gist options
  • Save sachinsaxena25/2ffd1b8ad6781852beddf9e082c2351e to your computer and use it in GitHub Desktop.
Save sachinsaxena25/2ffd1b8ad6781852beddf9e082c2351e to your computer and use it in GitHub Desktop.
#include<stdio.h>
int main(void){
int a = 0;
int b = 0;
int c = 0;
printf("please enter the first number: \n");
scanf("%d", &a);
printf("please enter the second number: \n");
scanf("%d", &b);
printf("The numbers before swapping are a = %d b = %d", a, b);
c = a;
a = b;
b = c;
printf("swapped number is: %d %d", a, b);
return 0;
}
@dbc2201
Copy link

dbc2201 commented Jul 29, 2019

#include<stdio.h>
int main(void){
	int a = 0;
	int b = 0;
	int c = 0;
	printf("please enter the first number: \n");
	scanf("%d", &a);
	printf("please enter the second number: \n");
	scanf("%d", &b);
        printf("The numbers before swapping are a = %d b = %d", a, b);
	c = a;
	a = b;
	b = c;
	printf("swapped number is: %d %d", a, b);
	return 0;
	
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment