Created
October 31, 2020 17:24
-
-
Save denkspuren/add79663b40d7f46b2039832ee80d460 to your computer and use it in GitHub Desktop.
Berechnung einer Quadratzahl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class Calculator { | |
public static void main(String... args) { | |
Scanner input = new Scanner(System.in); | |
System.out.print("Input number: "); | |
int n = input.nextInt(); | |
System.out.println("The square of " + n + " is " + square(n)); | |
} | |
static int square(int number) { | |
return number * number; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment