Last active
September 28, 2019 18:57
-
-
Save Vaysman/91551dced7f5d9338c14eeb307cca904 to your computer and use it in GitHub Desktop.
This file contains 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
package trash; | |
import java.util.Scanner; | |
public class LastDigit { | |
public static void main(String[] args) { | |
Scanner scanner = new Scanner(System.in); | |
System.out.print("Enter a number -> "); | |
long i = scanner.nextLong(); | |
System.out.println("The last digit is " + i % 10); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment