In this, we are going to write a simple program to find Sum of last digits of any three numbers in Java.
class Last_digit
{
public static void main(String[] args)
{
int a = 234, b = 456, c = 712, d;
d = a % 10 + b % 10 + c % 10;
System.out.println("Sum = " + d);
}
}
Post a Comment
FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP