blob: ecf0c748676088310f4849e3801fdc20ff873058 (
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;
n1=input("Number 1:")
n2=input("Number 2:")
a=n1
b=n2
while n1 ~=n2
if n1>n2 then
n1=n1-n2
else
n2=n2-n1
end
end
mprintf("GCD(%d,%d) is:%d",a,b,n1)
|