#include <stdio.h>
double min_array[]={12.46,5.48,17.96,35.47,14.68};
double min_value;

//int antal_element = 5;


  int i,j,temp;
// function 'find' 
double find(double arr[], int num){
  double min=arr[0];
  int i=1;
  while(i<num){
    if(arr[i]<min){
      min=arr[i];
    }
    i++;
  }
  return min;
}

double min_double(double min_array[], int antal_element){

  int i;
  int j;
  double temp=0; //not a bubble sort, as for every i, it sorts throught the remaining ellements
  for(i = 0; i < antal_element; i++)
    {
    for(j = i + 1;j < antal_element; j++)
      {
      if (min_array[i] > min_array[j])
	{       
	temp = min_array[i];
	min_array[i] = min_array[j];
	min_array[j] = temp;
      }
    }
  }
  return min_array[0];
}

int main(){

  double arr[5] = {0.5, 0.00002, 3.0, 2.0, 0.02};

  double min=find(min_array, 5);
  //double min_value = min_double(5);  
  printf("%.2f\n", min);
  min = min_double(min_array, 5);
   printf("%f\n", min);
}
