title: Write a program to find all twin primes less than 1,000. Display the output as follows: (3,5) (5,7)
body: <p>I am currently trying to write a program to find
  all twin primes less than 1,000. And then display the output as follows (3,5)(5,7).....(etc)</p>
  
  <p>So far I only have the code to find prime numbers, and am unsure as to what I should do to not only find the twin prime numbers, but how to print all of them properly.  Any advice is very appreciated, and a big thank you in advance!  Here is my code so far.</p>
  
  <pre><code>   int a =0;
     int b =0;
     String d = "";
     for (a = 1; a &lt;= 100; a++) {               
       int counter = 0;     
       for (b = a; b &gt;= 1; b--) {
         if (a % b == 0) {
           counter = counter + 1;
         }
       }
       if (counter == 2) {
         w = w + a + " ";
         // ..
  </code></pre>