if(min > sora[x]) {
min=sora[x];
}
else if (max < sora[x])
{
max=sora[x];
}
has the problem. The second else if
statement is entered only if the first if is satisfied. But the second if
has to be executed always. Please change the above block as follows
if(min > sora[x]) {
min = sora[x];
}
if (max < sora[x]) {
max = sora[x];
}
And you are also using an uninitialized area to compare against. If you are using only positive numbers
max = 0;
min = UINT_MAX;
If you use negative numbers also, then
max = INT_MIN;
min = INT_MAX;
You have to include <limits.h>
for these macros.