void swap(int x, int y) { int tmp = x; x = y; y = t; } int main() { int num1 = 111, num2 = 222; swap(num1, num2); printf("\n num1=[%d], num2=[%d]\n", num1, num2); }Use pointers to fix the code (try for a minimal number of changes).
void swap2(____________) { int tmp = _________; __________ = _________; __________ = _________; } int main() { int num[2] = {111, 222}; swap2(___________); printf("num[0]=[%d], num[1]=[%d]\n", num[0], num[1]); }The output should be
num[0] = 222, num[1] = 111