Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted as Java by Wkimball ( 5 years ago )
/**
 * This program determines the factors of a number
 * @Wkimball
 * @4/14/21
 */

public class FactorsandPrimes
{
    public static void main(String[] args)
    {
        for(int r = 1; r < 1000; r++)
        {
           for(int factor = 1; factor < r; factor++) 
           {
               if (r % factor == 0)
               {
                   System.out.print(factor + " ");
               }
           }
           System.out.print(r);
           System.out.println();
        }
    }
}

 

Revise this Paste

Your Name: Code Language: