Question: This is a basic prime number checker. How would I loop this code so it tells me every single number from 1 to 100 and if its prime or not. For example:

1 is not a prime number

2 is a prime number

3 is a prime number

and so on until 100. This is not a user generated program just straight up if I run it it gives me all 100 numbers

```
    int check;
    int number;
    boolean prime = true;
    for (int i=2; i<=check/2; i++)
    {
        number = check%i;
        if (number == 0)
        {
            prime = false;
        }
    }
    if (prime == true)
    {
        System.out.println(check + " is a prime number");
    }
    else
    {
        System.out.println(check + " is not a prime number");
    }
}

```

Answer: 
When you visually confirm whether a word is a palindrome or not, usually you would just check the characters from either end and start moving inwards. 

So really that's two steps:

1. Check the end bits of the char if they're the same. If they aren't, it's not a palindrome, otherwise, next step
2. Move inwards from both ends, and repeat #1 till there are 1 or 0 characters left to be checked. (Hint: If you can't use chars, maybe try using a single character string :) )
Compare the string char starting from head and tail. If all the letters are equal till the middle of the string it's palindrome.

```
boolean palindrome(string str){
  for(int i = 0 ; i < str.lenght()/2 ; i++) {
    if (str.charAt(i) != str.charAt(str.lenght() - i )
       return false;
  }
  return true;
}

```