Perfect Number

Write a program to check perfect number using pl/sql

10 comments:

  1. --problem 3

    declare
    n number(5);
    i number(5);
    summ number(5):=0;
    rec number(5):=0;
    function check_perfect(n in out number)
    return number is
    begin
    while i<n loop
    if mod(n,i)=0 then
    summ:=summ+i;
    end if;
    end loop;
    return summ;
    end;

    begin
    dbms_output.put_line('Enter a number to check weather the number perfect or not:');
    n:=&n;
    rec:=check_perfect(n);
    if rec=n then
    dbms_output.put_line('Enter number is perfect');
    else
    dbms_output.put_line('Enter number is not perfect');
    end if;
    end;
    /

    ReplyDelete
  2. Id:201330499

    SQL> declare
    2 j number(10);
    3 n number(10);
    4 summ number(10):=0;
    5 begin
    6 j:=&number;
    7 for n in 1..j-1 loop
    8 if mod(j,n)=0 then
    9 summ:=summ+n;
    10 end if;
    11 end loop;
    12 if (summ=j) then
    13 dbms_output.put_line('This is perfect number');
    14 else
    15 dbms_output.put_line('This is not perfect number');
    16 end if;
    17 end;
    18 /
    Enter value for number: 28
    old 6: j:=&number;
    new 6: j:=28;
    This is perfect number

    ReplyDelete
  3. hi welcome to this blog.its really informative blog.thank you for sharing this blog.it will be really helpful to the c programming learners.once again thank you .
    c programming training

    ReplyDelete
  4. how to find perfect number using procedure

    ReplyDelete
  5. I really appreciate the information shared above. It’s of great help. If someone want to learn Online (Virtual) instructor lead live training in #TABLEAU, kindly Contact MaxMunus
    MaxMunus Offer World Class Virtual Instructor-led training on #TABLEAU. We have industry expert trainer. We provide Training Material and Software Support. MaxMunus has successfully conducted 1,00,000 + training in India, USA, UK, Australia, Switzerland, Qatar, Saudi Arabia, Bangladesh, Bahrain, and UAE etc.
    Avishek Priyadarshi
    MaxMunus
    E-mail: avishek@maxmunus.com
    Skype id: avishek_2.
    Ph:(0) 8553177744 / 080 - 41103383
    www.MaxMunus.com

    ReplyDelete
  6. Its is very very helpful for all of us and I never get bored while reading your article because, they are becomes a more and more interesting from the starting lines until the end.

    Oracle Weblogic Server Training

    ReplyDelete
  7. Awe! What An Blog Very Helpful and interesting Really A great center for acquiring knowledge.Very Helpful Post And Explained Very Clearly About All the things.Very Helpful. Coming To Our Self We Provide Restaurant Equipment Parts .Really Thankfull For the blogger providing such a great information.Thank you. Have a Nice Day.

    ReplyDelete
  8. Thankful for the Informative Post The Best article, Bala Guntipalli

    ReplyDelete
  9. This Blog Provides Very Useful and great Information. United States Medical Licensing Examination Thanks for sharing.

    ReplyDelete

Popular Posts