Code

#include <stdio.h>

// function swap value for a and b
void swap(int *x, int*y){
	int temp = *x;
	*x = *y;
	*y = temp;
	
}
int main(){
	int a,b;
	scanf("%d %d", &a,&b);
	
	// Goi ham swap
	swap(&a, &b);
	printf("a = %d b = %d\n",a, b);
	return 0;	
}

Solving Approach

 

 

 

Upvote
Downvote
Loading...

Input

10 20

Expected Output

a = 20 b = 10