Given two int variables, i and j, which have been declared and initialized, and two other int variables

Given two int variables, i and j, which have been declared and initialized, and two other int variables

LANGUAGE: Visual Basic

CHALLENGE:

Given two int variables, i and j, which have been declared and initialized, and two other int variables, itemp and jtemp, which have been declared, write some code that swaps the values i and j by copying their values to itemp and jtemp, respectively, and then copying itemp and jtemp to j and i respsectively.

SOLUTION:

itemp = i
jtemp = j
j = itemp
i = jtemp

Add comment