Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * prog.c
- *
- * Created on: Sep 29, 2016
- * Author: dastan.iyembergen
- */
- #include <stdio.h>
- int minInd(int l, double arr[]){
- int i, minI;
- double min;
- for (i=0; i<l; i++){
- if (i==0 || min>arr[i]) {
- min=arr[i];
- minI=i;
- }
- }
- return minI+1;
- }
- int main(){
- double arr[5]={456, 45.2, 4688, 35.65, 12.96};
- printf("%i", minInd(5, arr));
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment