Skip to content

Instantly share code, notes, and snippets.

@Vaysman
Last active September 28, 2019 18:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Vaysman/91551dced7f5d9338c14eeb307cca904 to your computer and use it in GitHub Desktop.
Save Vaysman/91551dced7f5d9338c14eeb307cca904 to your computer and use it in GitHub Desktop.
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