do the Java program in copy
Attachments:
Answers
Answered by
0
import java.io.*;
import java.util.*;
class Q
{
public static void main()
{
int ar[]=new int[3];
Scanner ob=new Scanner(System.in);
int sum=0;
int lastd=0;
System.out.println("Enter 3 numbers");
for(int x=0;x<3;x++)
{
ar[x]=ob.nextInt();
}
for(int x=0;x<3;x++)
{
lastd=ar[x]%10;
sum=sum+lastd;
}
System.out.println("output- "+sum);
}
}
Similar questions