to find greatest of n numbers