Computer Science, asked by rajdeep3398, 1 year ago

do the Java program in copy

Attachments:

Answers

Answered by srinitishsri
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