Ok so I fixed a few things and changed some of the variables that where written as two different things but should have been carried over as one. So JDGATX, your saying to get rid of the variable n?
here is the new code I think I have get_min_range right now Ill look at sort_arr
Code:
// Array.cpp : Defines the entry point for the console application.
//
#include<stdio.h>
#include<stdafx.h>
#include"conio.h"
#include<math.h>
#define x 10
int get_min_range(int arr[], int small, int last)
{
small=0;
for(last=1; last<x; ++last)
if (last<small)
arr[small]=arr[last];
return(small);
}
void sort_arr(int arr[], int n)
{
int small, temp=0, index_of_min;
for (small = 0; small < x-1; ++small)
index_of_min = get_min_range(arr, small, x-1);
if (small != index_of_min)
temp = arr[index_of_min];
arr[index_of_min] = arr[small];
arr[small] = temp;
}
int main()
{
int f=0, n=0, arr[x];
for(int n=0; n<x; n++)
{
printf("Enter a number in the array:");
scanf_s("%d", &arr[n]);
}
sort_arr( arr, n);
for(f=0; f<x; f++)
printf("%d", arr[f]);
getch();
return (0);
}