The problem is that the program seems to leap over the central part of the code when executed, so it goes directly from the while loop to the system pause as indicated, ignoring all the ifs...

Some help...

Code:
#include <stdio.h>

#define NMAX 100

main(void)
{
  float datos[NMAX],max,min;
  int nelementos=0,i=0;
  
  printf("Introducir datos (0 para finalizar)\n");
  printf("dato[%d]: ",i);
  while(i<NMAX&&scanf("%f",&datos[i])!=EOF){
    i++;
    printf("dato[%d]: ",i);
  }
  
//this part isnt executed apparently...  
 
 nelementos=i;
  if(nelementos>0){
    max=min=datos[0];
    for(i=0;i<nelementos;i++){
      if(datos[i]>max)
        max=datos[i];
      if(datos[i]<min)
        min=datos[i];
      }
    printf("Valor maximo: %g,valor minimo: %g",max,min);
  }        
  else printf("no hay datos\n");

//and program continues here 
  system("pause");
  return 0;
}