I'm not sure it's worth the effort for just 4 variables, but the problem can be generalized to an efficient solution for any number of variables. That solution would include the use of an array or...