13.07.2015 Views

A practical introduction to Pascal programming language - GIARA

A practical introduction to Pascal programming language - GIARA

A practical introduction to Pascal programming language - GIARA

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

A Practical Introduction <strong>to</strong> <strong>Pascal</strong> Programming Languagefor i:=1 <strong>to</strong> n dobeginfor j:=1 <strong>to</strong> n doif (i=1) then(* first row *)write(’ ’,j:3,’ ’)else if (i=n) then(* last row *)write(’ ’,n-j+1:3,’ ’)else if (j=1) then(* first column *)write(’ ’,i:3,’ ’)else if (j=n) then(* last column *)write(’ ’,n-i+1:3,’ ’)elsewrite(’ ’);writelnendend.⊡64

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!