Simple program to check whether a number is prime or not. Something is seriously wrong because every result I get is 'false'. Help me out please. Thanks in advance.
class primeTesting {
public static void main(String[] args){
int i=7; //changing the value everytime always gives false.... ???
boolean bool=false;
for(int c=i-1;c>1;c--){
if(c%i==0){
bool=true;
break;
}
}
System.out.println(""+bool);
}
}