Hallo,
ich war heute mal am programmieren und habe auch was zu stande gebracht, nun funktioniert es nicht! was habe ich falsche gemcaht?? kann mir hier zufällig wer weiterhelfen?
void maximum (int a, {
if (a> maximum = a;
else maximum = b;
}
public static void main (String args[]) {
int x=3, y = 5;
System.out.println("Von "+x+" und "+y+" ist "+maximum+"die größere Zahl.")
}
[/code]
2.Code:
[code]
void gegenzahl(int a, boolean anw) {
if (anw) {a = -a;}
}
float kehrzahl(float a) {
float b = 1 / a;
return b;
}
public static void main (String args[]) {
int c = 3, d = 4;
int e = gegenzahl (5, false);
gegenzahl(true, c);
int f = kehrzahl (c/d);
float g = kehrzahl(c, d);
float h = kehrzahl(gegenzahl(-3, true)/10);
wäre cool wenn mir wer weiterhilft!