PL/SQL Program to Print Patterns

Here you will get plsql programs to print patterns of stars, numbers and alphabets.

Pattern 1:

Pattern 2:

Pattern 3:

Pattern 4:

Pattern 5:

Pattern 6:

Pattern 7:

Comment below if you need any other pattern. I will try to add it here.


11 thoughts on “PL/SQL Program to Print Patterns

    1. akash ithape

      declare
      n number:=5;
      i number;
      j number;
      begin
      for i in 1..n
      loop
      for j in 1..i
      loop
      dbms_output.put(‘1’);
      end loop;

      dbms_output.new_line;
      end loop;
      end;
      /

      Reply
        1. ddl

          declare
          n number:=5;
          i number;
          j number;
          begin
          for i in 1..n
          loop
          for j in 1..i
          loop
          dbms_output.put(‘J’);
          end loop;
          dbms_output.new_line;
          end loop;
          end;
          /

          Reply
  1. ravi

    pl/sql is not able to add space
    declare
    n number:=10;
    i number:=1;
    j number;
    k number;
    begin
    while i<n
    loop
    j:=1;
    while j=1
    loop
    j:=9;
    while j>i
    loop
    dbms_output.put(‘ ‘);
    j:=j-2;
    end loop;

    for k in 1..i
    loop
    dbms_output.put(‘*’);
    end loop;

    dbms_output.new_line;
    i:=i-2;
    end loop;
    end;
    /

    Reply
  2. SUMA

    IF AM GIVING INPUT AS 1 THEN I NEED TO GET OUTPUT AS 1,IF INPUT IS 2 THEN OUTPUT SHOULD BE AS 2
    2 2
    IF INPUT IS 3 THEN OUTPUT SHOULD BE 3
    3 3
    3 3 3

    Reply

Leave a Reply

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