English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

take a n x m matrix where the orders can be given.
the matrix must have the output as printed as:

***0*
00*0*
*****
*0*0*
*0***

and also
in triangle format

0000*00000
000*0*0000
00*0000*00
0*000000*0
*********

2007-10-29 01:49:37 · 1 answers · asked by gunaroopam r 1 in Computers & Internet Programming & Design

1 answers

To print a 1 dimension array (In computing it is an Array. In mathematics it is a Matrix) you require a loop.

for (i=0; i print arrayData[i]
}

Now for a 2 dimension array you require 2 loops

for (i=0; i for (j=0; j print arrayData[i][j]
}
print newLine
}

Now you can do the rest. Have I got the programming language wrong? Well what hint did you give me!

2007-10-29 02:12:16 · answer #1 · answered by AnalProgrammer 7 · 0 0

fedest.com, questions and answers