/* Programma ESER02a.CPP - ESER02.CPP versione con uso di un vettore */ #include #include const int N = 5; // Variabili globali double a[N]; void CarArray(int N); // Prototipo di function void main(void) { int i; double Min; clrscr(); gotoxy(31,1); cout << "CALCOLO DEL MINIMO\n\n"; CarArray(N); // Chiamata a function Min = a[0]; i = 1; do { if (Min > a[i]) Min = a[i]; ++i; } while (i < N); cout << "\nMinimo = " << Min; cout << "\n\nPremere un tasto per uscire... "; getch(); } void CarArray(int N) { // Definizione di function register int i; int k=0; for (i=0; i> a[i]; } } /* ***************************** Outputs ****************************** */