Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  MCD
Language: PASCAL
Code:
program HelloWorld;
var
  num1,num2,num3:integer;

begin

writeln('inserire il primo numero maggiore: ');
Readln(num1);
writeln('inserire il secondo numero minore del primo: ');
Readln(num2);
num3:= 1;
while  (num3<>0) do 
begin 
num3:= (num1 mod num2); 
num1:= num2;
num2:= num3;
end;
writeln('il MCD risulta: ',num1);
readln;
end.          
          
Comments: