Assignment #131: Create Your Own Array

Code

public class ArraysII {

    public static void main(String[] args) {
    
        int[] intArray = {2, 4, 1, 10};
        
        System.out.println(intArray[0] + " + " + intArray[1] + " = " + (intArray[0] + intArray[1]));
        
        System.out.println(intArray[1] + " - " + intArray[2] + " = " + (intArray[1] - intArray[2]));
        
        System.out.println(intArray[2] + " x " + intArray[3] + " = " + (intArray[2] * intArray[3]));
        
        System.out.println(intArray[3] + " / " + intArray[0] + " = " + (intArray[3] / intArray[0]));
        
    }
    
}
        
        
    

Picture of the output