#include using namespace std; float kehrwert(float zahl) { if (zahl == 0) throw (char*) "Division durch null!"; return 1/zahl; } int main() { try { float x; cout << "x = "; cin >> x; float y = kehrwert(x); cout << "Kehrwert ist " << y << endl; } catch (char* ausnahme) { cout << "Fehler aufgetreten: " << endl; cout << ausnahme << endl; } return 0; }