====== Grundaufgaben zu Arrays ====== // Programm: array-grundlagen.cpp // Beschreibung: Dieses Programm realisiert einige Grundaufgaben mit 1dim-Arrays // Autor: JL #include // Zusatzbibliothek für Ein-und Ausgaben wird eingebunden #include // Zusatzbibliothek für Konsole wird eingebunden #include // Zusatzbibliothek für Zufallsgenerator #include // Zusatzbibliothek für Initialisierung des Zufallsgenerators using namespace std; // Standard-Namensraum wird eingestellt #define MAX 10 void erstellen(int a[MAX]){ srand(time(NULL)); // Initialisierung des Zufallsgenerators for (int i=0;i> index; cout << "Die Zahl mit Index " << "lautet " << zzahl[index]; } // Menüpunkt (e) if (wahl=='e') { erstellen(zzahl); ausgabe(zzahl); int zahl; cout << "Bitte Zahl eingeben: "; cin >> zahl; if (suche(zzahl,zahl)) cout << "Zahl ist im Array vorhanden\n"; else cout << "Zahl ist im Array nicht vorhanden\n"; } } while (!(wahl==27)); // Programm lauft solange bis ESC gedrückt wird getch(); return 0; }