Write an algorithm to find the largest and smallest number among three given numbers as given as input