View Single Post
  #1 (permalink)  
Old March 11th, 2018, 07:14 PM
dTech dTech is offline
Registered User
Points: 5, Level: 1
Points: 5, Level: 1 Points: 5, Level: 1 Points: 5, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Feb 2018
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Printing multiples of 13 using array

Hi, I'm new. I'm trying to use an array to print out multiples of 13, up to 400. (I know 400 isn't one of them.) All my computer prints out are zeros.

Here's my code:

Code:
 
class multiples {
    public static void main(String[] argumets){
        int mults [] = new int [400];
        
        for  (int dex = 0; dex < mults.length; dex++){
            int current = mults[dex];
            if (current % 13 == 0){
                System.out.println("#: " + current);
            }
        }
    }
}
Can someone tell me why it only prints zeros? Thanks in advance.
Reply With Quote