Advertisement
Guest User

Untitled

a guest
Jan 20th, 2017
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. float minimum(float p[],int n);
  5.  
  6. int main ()
  7. {
  8. float *p,y;
  9. int N,i;
  10. printf("Give size of array: ");
  11. scanf("%d",&N);
  12.  
  13. p=malloc(sizeof(float)*N);
  14.  
  15. if (!p)
  16. {
  17. printf("Adinamia Desmeusis Mnimis!");
  18. exit(0);
  19. }
  20. printf("Give the Numbers");
  21. for (i=0; i<N; i++)
  22. {
  23. scanf("%f",&p[i]);
  24. }
  25. y=minimum(p,N);
  26. printf("O elaxistos arithmos ine: %1.0f",y);
  27. return 0;
  28. }
  29.  
  30. float minimum(float p[], int N)
  31. {
  32. int i;
  33. float min;
  34. min=100;
  35. for (i=0; i<N; i++)
  36. {
  37. if (p[i]<min)
  38. min=p[i];
  39.  
  40.  
  41. }
  42. return min;
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement