thank you for your help...
i had already noticed the problem and i fixed it..
i don't understood your [you can simply check the boolean, as in: if ( p ) or if ( !p )] if you can kindely explain...(sorry ,i am a beginner...)
here is my new code...this time its do the job !
public class Premiers{
public static void main(String[]args){
int n=2,pn=0;
boolean p=true;
while(pn<100){
for(int d=2;d<n;d=d+1){
if(n%d==0){
p=false;
}
}
if(p!=false){
Terminal.ecrireStringln(n+" est un n.primer");
pn=pn+1;
}
n=n+1;
p=true;
}
Terminal.ecrireIntln(n);
}
}