Assignemnt #106 Prime.java

Code

    /// Name: Boris Kazantsev
    /// Period: 6
    /// Program Name: Prime
    /// File Name: Prime.java
    /// Date Finished: 3/28/2016
    
   public class Prime
{
	public static void main( String[] args )
	{
		for (int i = 0; i < 20; i++)
		{
			System.out.println((i + 1) +" "+ (Prime(i + 1) ? "<" : ""));
		}
	}

	public static boolean Prime(int n)
	{
		for (int i = 2;i < n;i++)
		if (n%i==0) return false;

		return true;
	}

}
   
    

Picture of the output

Assignment 106