Code is copied!
Program to print the last digit of the number JAVA
Write a Program to print the last digit of the number.
import java.util.*; class lastdigit { public static void main(String args[]) { Scanner sc = new Scanner (System.in); int a = sc.nextInt(); int d = a % 10; System.out.println("Last digit of "+a + " is " +d); } }