how to solve prime number program? : I'm trying to print all the prime numbers between 2 and 100, but i'm getting only 2 & 3.

I've tried every possible alternates, and it comes up with different error or different output.

```class vision{
```public static void main(String args[]){
```boolean flag=true;
```for( int i=2;i<=100;i++){
```for(int j=2;j<i;j++){
```if(i%j==0){
```flag=false;
```break;
```}
```}
```if(flag){
```System.out.println(i);
```}
```}
```}
```}

i don't need any alternate way , i just wanna know what's happening in my code and why it gives only 2 & 3.