#include <stdio.h> void swap(int *p1, int *p2) { // Your logic here int a = *p1; int b = *p2; *p1 = b; *p2 = a; } int main() { int a, b; scanf("%d %d", &a, &b); swap(&a, &b); printf("a = %d ", a); printf("b = %d", b); return 0; }
Test Cases
Test Results
Input
10 20
Expected Output
a = 20 b = 10