16 lines
343 B
Plaintext
16 lines
343 B
Plaintext
public class Aufgabe3 {
|
|
public static void main(String[] args) {
|
|
System.out.println("3 * 4 = " + mult(3,4));
|
|
System.out.println("45 * 12 = " + mult(45,12));
|
|
|
|
}
|
|
|
|
|
|
public static int mult(int a, int b) {
|
|
int result=0;
|
|
for (int i = a; i != 0 ;i-- ) {
|
|
result+=b;
|
|
} // end of for
|
|
return result;
|
|
}
|
|
} |