C++ Program testing Function of Rand Method