answersLogoWhite

0

1)strong number

1 declare

2 n number(3);

3 fact number(3):=1;

4 rem number(3);

5 m number(3);

6 sum1 number(3):=0;

7 begin

8 dbms_output.put_line('enter a number');

9 n:=&n;

10 m:=n;

11 while(n>0) loop

12 rem:=mod(n,10);

13 for i in 1..rem loop

14 fact:=fact*i;

15 end loop;

16 sum1:=sum1+fact;

17 n:=trunc(n/10);

18 fact:=1;

19 end loop;

20 if(sum1=m) then

21 dbms_output.put_line(m' IS STRONG NUMBER');

22 else

23 dbms_output.put_line('IT IS NOT STRONG NUMBER');

24 end if;

25* end;

User Avatar

Wiki User

12y ago

Still curious? Ask our experts.

Chat with our AI personalities

MaxineMaxine
I respect you enough to keep it real.
Chat with Maxine
LaoLao
The path is yours to walk; I am only here to hold up a mirror.
Chat with Lao
SteveSteve
Knowledge is a journey, you know? We'll get there.
Chat with Steve

Add your answer:

Earn +20 pts
Q: Strong number in plsql
Write your answer...
Submit
Still have questions?
magnify glass
imp