Advertisement
lucontre

ALP practico 5 problema 1

May 31st, 2018
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.50 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. float FuncionMaximo(float b[]);
  4. int i,j;
  5. int main()
  6. {
  7.  
  8. do{
  9. printf("cuanto datos ingresara ? \n");
  10. scanf("%i",&i);}
  11. while(i<=0);
  12.  
  13. float array[i];
  14. for(j=0;j<i;j++){
  15.     printf("ingrese valor %i",j);
  16.     scanf("%f",&array[j]);
  17. }
  18.  
  19. printf("%.2f", FuncionMaximo(array) );
  20.  
  21.     return 0;
  22. }
  23. float FuncionMaximo(float b[]){
  24.     int j;
  25.     float max = b[0];
  26.     for(j=0;j<i;j++){
  27.         if(max< b[j]){
  28.             max = b[j];}
  29.     }
  30.     return max;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement