Perfect Number

Write a program to check perfect number using pl/sql

3 comments:

  1. declare
    j number(10);
    n number(10);
    sum number(10):= 0;
    begin
    j:=#
    for n in 1..j-1 loop
    if mod(j,n)=0 then
    sum=sum+n;
    end if;
    end loop;
    if sum=j then
    dbms_output.put_line("perfect no.");
    else
    dbma_output.put_line("not perfect");
    end if;
    end;/

    ReplyDelete

Popular Posts

Total Pageviews

Followers