It was a joke. Finding the largest and smallest numbers from a given set is pretty easy.
You need two variables, one for the largest number(Initialize very small) and one for the smallest (Initialize very large).
Then read in your numbers one after the other, and if they are smaller than/larger than the respective variables simply assign the variable the value of that number.
sorry my mistake...what i meant here is how to do the coding using the vector..and i have 5 inputs to compare..i don't really know how to use vector..if you mind to show me an example?
You could initialise them both to zero, no need to initialise them to small / large values.
In this case a less than check (for smallest number) would always favour the zero. And if negative numbers are involved then the largest number might be compromised as well.
I guess the best route would be to initialize both to the first value read.