Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * File: main.c
- * Author: Gerardo Cicalese
- *
- * Created on 16 settembre 2019, 15.48
- */
- #include <stdio.h>
- #include <stdlib.h>
- int whatsmin(int * vex, int n){
- if(n>1){
- int a=whatsmin(vex, n-1);
- if(vex[n]<a)
- return vex[n];
- else
- return a;
- }
- return *vex;
- }
- int main(void){
- int min, vex[]={63, 15, 42, 63, 92, 34, 77, 23, 78, 37, 26, 7, 79, 85, 82, 19, 89, 10, 64};
- size_t len=sizeof(vex)/sizeof(vex[0])-1;
- min=whatsmin(vex, len);
- printf("Minimum is %d\n", min);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement