Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Georg Farrugia 4G
- *
- * Write a program that asks the user to input 10 int numbers, store them
- * in an array
- */
- public class array{
- public static void main(String args[]){
- int a [];
- a = new int[9];
- int tot = 0;
- for(int i = 0; i <= 8; i ++){
- System.out.print("Number: " + (i + 1));
- a[i] = Keyboard.readInt();
- tot = tot + a[i];
- }
- for(int i = 0; i <= 8; i ++){
- System.out.println(a[i]);
- }
- System.out.println("Total is: " + tot);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement