Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function lp(x){
- for(var i=2;i*i<=x;i++)
- if(x%i==0)
- return false;
- return true;}
- var x=parseInt(prompt("Podaj liczbe"));
- if(lp(x))
- document.write("Jest liczba pierwsza");
- else
- document.write("Nie jest liczba pierwsza");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement