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);
    }
}



     
                     

Contact Us

REACH US

SERVICES

  • CODING
  • ON-LINE PREPARATION
  • JAVA & PYTHON

ADDRESS

B-54, Krishna Bhawan, Parag Narain Road, Near Butler Palace Colony Lucknow
Contact:+ 919839520987
Email:info@alexsir.com