Sie sind auf Seite 1von 1

Aufgabe 1.

1 Min, Max, Mittlerer Wert


Deklaration und Initialisierung
int a=10;
int b=2;
int c=5;

int min, max;

Initialisierung
min=a;
max=a;

if (b<min)
T F

if (b>max)
T F
min=b;
max=b;

if (c<min)
T F

if (c>max)
T F
min=c;
max=c;

Ausgabe
cout << "min=" << min
<< ", mittlere Zahl=" << a+b+c-min-max
<< ", max=" << max
<< endl;

Aufgabenteil 2

float mittelwert;

mittelwert=(a+b+c)/3.0;

cout << "Mittelwert=" << mittelwert


<< endl;

Das könnte Ihnen auch gefallen