prateeksharma

DBMS_Assignment_9

Nov 29th, 2019
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. DECLARE
  2. a int := 5;
  3. s int := 1;
  4.  
  5. BEGIN
  6. while(a>1)
  7. LOOP
  8. s:=s*a;
  9. a:=a-1;
  10. END LOOP;
  11. dbms_output.put_line('fact '|| s);
  12. END;
  13.  
  14.  
  15.  
  16.  
  17. a number :=8;
  18. c number :=0;
  19. begin
  20. for i in 2..5
  21. loop
  22. if mod(a,i)=0
  23. then
  24. c:=c+1;
  25. end if;
  26. end loop;
  27. if c=1
  28. then
  29. dbms_output.put_line('prime number');
  30. else
  31. dbms_output.put_line('Not a prime number');
  32. end if;
  33. end;
Add Comment
Please, Sign In to add comment