Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- a = input("Podaj liczbe: ")
- if a<2 then
- disp("Liczba nie jest pierwsza")
- elseif a == 2 then
- disp("Liczba jest pierwsza")
- else
- for i=2:1:a-1
- if modulo(a,i)==0 then
- disp("Liczba nie jest pierwsza")
- break
- elseif i == a-1
- disp("Liczba jest pierwsza")
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement