I'm looking for a way to sum up the numbers located in specific positions like say the even positions. So if the user enters 84920 0 is in position 1, 2 is in position 2, 9 is in position 3 so on and so forth. The sum of the numbers in even positions would be 2+4=6. So far all I have is this:
import java.util.Scanner;
public class Sums {
public static void main (String[] args){
Scanner myScanner;
myScanner = new Scanner(System.in);
System.out.println("Enter a number: ");
int A = myScanner.nextInt();