ArrayTest2.java



public class ArrayTest2 {

    public static void main( String[] args ) {

        int a[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
        inverse( a );
    }

    public static void inverse( int[] a ) {

        float inv;
        for( int i=0; i<a.length; i++ ) {

            inv = 1.0f / a[i];
            System.out.println( "1/" + a[i] + "=" + inv );
        }
    }
}