PL/SQL Program to Find GCD of Two Numbers

PL/SQL Program to Find GCD of Two Numbers :



declare  
no1 number; 
no2 number; 
temp number;
begin
no1:=:no1;
no2:=:no2;
while mod(no2,no1)!=0
loop
 temp:=mod(no2,no1);
 no2:=no1;
 no1:=temp;
end loop;
dbms_output.put_line('GCD of '||no1||' and '||no2||' is '||no1); 
end;

OUTPUT:

GCD of 8 and 48 is 8




2 thoughts on “PL/SQL Program to Find GCD of Two Numbers

  1. Pingback: Cialis 5 mg
  2. Pingback: writeaessay

Leave a Reply

Your email address will not be published. Required fields are marked *

five × two =

This site uses Akismet to reduce spam. Learn how your comment data is processed.