Code of van neuman loves binary

package challenges1;
import java.util.Scanner;
public class vonNeumenBinary {

public static void main(String[] args) {
	Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int arr[] = new int[N];
    int ans =0;
	int multiplier = 1;

    for(int i=0;i<=arr.length-1;i++)
	{
    	
    	arr[i] = sc.nextInt();
    	int rem = arr[i] % 10;
    	ans = ans + (rem * multiplier);
    	multiplier = multiplier * 2;
    	arr[i] = arr[i] / 10;
	}
    System.out.println(ans);

}

}

public static int binaryToDecimal(int n){
int num = n;
int dec_value = 0;

// Initializing base  
// value to 1, i.e 2^0 
int base = 1; 

int temp = num; 
while (temp > 0) 
{ 
    int last_digit = temp % 10;  // Extract rightmost digit 
    temp = temp / 10;               // Update the number

    dec_value += last_digit * base;  // Add the digit to the answer

    base = base * 2;               //Update the power of 2 
} 

return dec_value;                 // Return ans

}

lot of mistakes are there in ur code
pls make ur code for n input numberes

if u have any problem in understanding
dont hesitate to ask

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.