blob: c50d792bea7e82daf75017fceb5381cfef5c9ed2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
//Chapter 04:Number Theory and Cryptography
clc;
clear all;
n=input("Enter the number:")
c=0
for i =2:n-1
if modulo(n,i)==0 then
c=c+1
end
end
if c==0 then
mprintf("%d is a prime number",n)
else
mprintf("%d is not a prime number",n)
end
|