I suppose this is homework :-)
michael Boothby wrote:
I need to use for loops and no sort algorithms
You
need a sort alogorithm, but must implement it yourself, I'd do some research as knowing the various alogrithms available is handy. Bubble sort is easiest but is slow for large lists.
Personally, for a homework question like this, I'd create a destination array the same size as your original, then iterate over the orignal and insert into your destination array keeping the destination array sorted. That way your source array stays in tact, this can be done very quickly in C/C++. Then get the middle value.