text: updating the minrange
code: if ( ( maxval - minval ) < minrange ) { minel = minval ; maxel = maxval ; minrange = maxel - minel ; } } System . out . printf ( "The smallest range is [%d, %d]NEW_LINE", minel, maxel); }