Algorithms/Find minimum

From Wikibooks, open books for an open world
Jump to: navigation, search

int find_min(int a[],int len) { int min; if(len==1) return 1; else if(len=0) return 0;

min=a[0]; for(int i=1;i<len;i++) { if(a[i]<min) { min=a[i]; } } return min; }