I did everything except that I don't know how to right justify it?.

I would be really thankful if someone could help me.

thanks.

public class Q1 { public static void main(String[] args) { int[] nums = new int[100]; int j = 2, q = 0, num = 2, count = 0; double m = Math.sqrt(num); boolean isPrime = true; while (q < 100) { while (j <= m && isPrime) { if (num % j == 0) isPrime = false; else j++; } j = 2; if (isPrime == true) { nums[q] = num; System.out.print(nums[q] + " "); count++; q++; } if (count == 10){ System.out.println(); count = 0; } isPrime = true; num++; m = Math.sqrt(num); } } }

*Edited: topic title changed to a more meaninful title "Question" is really useless

Code tags fixed. Please

This post has been edited by **pbl**: 14 April 2012 - 08:26 PM