In this program a temporal variable named temp is used. Here, value of first variable is copied to temp and value of second variable was copied to first and value of temp is copied to second variable. Thus the values of 2 variables are swapped.