Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7680843
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T18:12:30+00:00 2026-05-31T18:12:30+00:00

How I can draw a Pascal’s triangle in PASCAL Programming like a diamond from

  • 0

How I can draw a Pascal’s triangle in PASCAL Programming like a diamond from n number which we get that from input?

Edit:
This program I tried:

program Pascal_triangle;
var
i,j,n : integer;
A : Array[1..6,1..6] of Integer;
begin
   n := 6;
   for i:=1 to n do
   begin
      for j:=1 to i do
      begin
         if (j=1) or (i=j) then
         begin
            A[i,j]:=1;
         end
         else
         begin
            A[i,j] := A[i-1,j] + A[i-1,j-1];
         end;
      end;
   end;
   for i:=1 to n do
   begin
      Gotoxy(41-i,i);
      for j:=1 to i do
         write(A[i,j])
   end;
   readln;
end.

but I got an error on gotoxy line and I need it to be diamond.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T18:12:31+00:00Added an answer on May 31, 2026 at 6:12 pm

    Dec 31 ’11 at 21:22: Thanks, I wrote this and works

    program Pascal_triangle;
    var d,c,y,x,n : integer;
       begin
          readln(n);
          writeln;
          for y:=0 to n do
          begin
             c:=1;
             for d:=0 to n - y do
             begin
                write(' ');
             end;
             for x:=0 to y do
             begin
                write(c);
                write(' ');
                c := c * (y - x) DIV (x + 1);
             end;
             writeln;
          end;
          for y:=n-1 downto 0 do
          begin
             c:=1;
             for d:=0 to n - y do
             begin
                write(' ');
             end;
             for x:=0 to y do
             begin
                write(c);
                write(' ');
                c := c * (y - x) DIV (x + 1);
             end;
             writeln;
          end;
          readln;
       end.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm wondering if there's a funciton in Java that can draw a line from
I subclassed View to get an View on which the user can draw with
I have my program that can draw rectangles. I have two problems I can't
I need a UIImageView that can draw itself in color or b/w according to
I have mysql database and I want a software which can draw the database
I have an NSView in which the user can draw circles. These circles are
the pixman image library can draw radial color gradients between two circles. I'd like
looking for windows software who can draw a Use Case diagram like yuml.me anyone
I'm using a graphing package that can draw lines of color (255,255,255). So basically
I want to make an application in which I can draw a path on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.