Array1 - for(i=0;i<array.length;i array[i =...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
import java.util.*; public class Array1 { static Scanner console = new Scanner(; public static void main(String[]args) { int a; int i; int prod = 5; System.out.println("Please enter the size of the Array"); a = console.nextInt(); System.out.println("The Array Size is = " + a); int[] array = new int[a]; System.out.println("Enter the First Value");
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: for(i=0;i<array.length;i++) array[i] = console.nextInt(); for(i=0;i<array.length;i++) System.out.print(array[i] + " "); for(i=array.length-1;i>=0;i--) System.out.print(array[i] + " "); for(i=0;i<array.length;i++) prod = prod * array[i]; System.out.println(" "); System.out.print(prod + " "); }}...
View Full Document

This note was uploaded on 10/04/2010 for the course COMPUTER S 106 taught by Professor Moore during the Spring '08 term at Clark Atlanta.

Ask a homework question - tutors are online