Assignemnt #106

Code

    Name: Mahima Choudhary
    Period: 6
    Project Name: Primeness
    File Name: Primeness.java
    Date: 3/31/2015
    
public class Primeness
{
	public static void main( String[] args )
	{
		for (int i = 0; i < 20; i++)
		{
			System.out.println((i + 1) +" "+ (isPrime(i + 1) ? "<" : ""));
		}
	}

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

		return true;
	}

}



    

Picture of the output

Assignment 103