You have made mistakes in the code to do the largest AND smallest.
First off, consider the test case of a user inputting ONE number only.
Let us say that number is 10.
Then your code will report that correctly for the largest BUT report 0 for the smallest. The problem here is that you have assumed that the largest and smallest number cannot occur together. Same problem exists if you enter 3,5,10.
Second issue is that you start with the smallest number equal to zero. That is obviously a mistake. There are (easy) two ways round that (a) set smallest to be the biggest possible integer, (b) use a flag.
Let me show your how to to the latter.
// Note that i is acting both as the loop variable and the flag
for(int i=0;i<UserInput;i++)
{
if (!i || smallest>number)
smallest=number;
}
Yes it adds an extra test. That is sometimes a problem.