Results 1 to 5 of 5
  1. #1
    kHim is offline Member
    Join Date
    Nov 2008
    Posts
    5
    Rep Power
    0

    Default two-dimensional array

    heLLo,,!!
    cAn u pLeAse give mE tHE cOde of tHis oUtpUt using two dimensional array?
    thAnks a lot,,,

    @
    @@
    @ @
    @@@@
    @ @
    @@ @@
    @ @ @ @
    @@@@@@@@
    @ @
    @@ @@
    @ @ @ @
    @@@@ @@@@
    @ @ @ @
    @@ @@ @@ @@
    @ @ @ @ @ @ @ @
    @@@@@@@@@@@@@@@@
    @ @
    @@ @@
    @ @ @ @
    @@@@ @@@@
    @ @ @ @
    @@ @@ @@ @@
    @ @ @ @ @ @ @ @
    @@@@@@@@ @@@@@@@@
    @ @ @ @
    @@ @@ @@ @@
    @ @ @ @ @ @ @ @
    @@@@ @@@@ @@@@ @@@@
    @ @ @ @ @ @ @ @
    @@ @@ @@ @@ @@ @@ @@ @@
    @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @
    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    Last edited by kHim; 11-16-2008 at 12:24 PM.

  2. #2
    kHim is offline Member
    Join Date
    Nov 2008
    Posts
    5
    Rep Power
    0

    Default a

    @
    @@
    @ @
    @@@@
    @ @
    @@ @@
    @ @ @ @
    @@@@@@@@
    @ @
    @@ @@
    @ @ @ @
    @@@@ @@@@
    @ @ @ @
    @@ @@ @@ @@
    @ @ @ @ @ @ @ @
    @@@@@@@@@@@@@@@@
    @ @
    @@ @@
    @ @ @ @
    @@@@ @@@@
    @ @ @ @
    @@ @@ @@ @@
    @ @ @ @ @ @ @ @
    @@@@@@@@ @@@@@@@@
    @ @ @ @
    @@ @@ @@ @@
    @ @ @ @ @ @ @ @
    @@@@ @@@@ @@@@ @@@@
    @ @ @ @ @ @ @ @
    @@ @@ @@ @@ @@ @@ @@ @@
    @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @
    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

  3. #3
    pranavss11 is offline Member
    Join Date
    Nov 2008
    Posts
    1
    Rep Power
    0

    Default

    Cross poster on sun forums.

  4. #4
    prometheuzz is offline Member
    Join Date
    Nov 2008
    Posts
    4
    Rep Power
    0

    Default

    Quote Originally Posted by kHim View Post
    heLLo,,!!
    cAn u pLeAse give mE tHE cOde of tHis oUtpUt using two dimensional array?
    thAnks a lot,,,
    ...
    Sure:
    Java Code:
    char[][] triangles = {
        {'@'},
        {'@','@'},
        {'@',' ','@'},
        {'@','@','@','@'},
        {'@',' ',' ',' ','@'},
        {'@','@',' ',' ','@','@'},
        {'@',' ','@',' ','@',' ','@'},
        {'@','@','@','@','@','@','@','@'},
        {'@',' ',' ',' ',' ',' ',' ',' ','@'},
        {'@','@',' ',' ',' ',' ',' ',' ','@','@'},
        {'@',' ','@',' ',' ',' ',' ',' ','@',' ','@'},
        {'@','@','@','@',' ',' ',' ',' ','@','@','@','@'},
        {'@',' ',' ',' ','@',' ',' ',' ','@',' ',' ',' ','@'},
        {'@','@',' ',' ','@','@',' ',' ','@','@',' ',' ','@','@'},
        {'@',' ','@',' ','@',' ','@',' ','@',' ','@',' ','@',' ','@'},
        {'@','@','@','@','@','@','@','@','@','@','@','@','@','@','@','@'},
        {'@',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','@'},
        {'@','@',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','@','@'},
        {'@',' ','@',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','@',' ','@'},
        {'@','@','@','@',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','@','@','@','@'},
        {'@',' ',' ',' ','@',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','@',' ',' ',' ','@'},
        {'@','@',' ',' ','@','@',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','@','@',' ',' ','@','@'},
        {'@',' ','@',' ','@',' ','@',' ',' ',' ',' ',' ',' ',' ',' ',' ','@',' ','@',' ','@',' ','@'},
        {'@','@','@','@','@','@','@','@',' ',' ',' ',' ',' ',' ',' ',' ','@','@','@','@','@','@','@','@'},
        {'@',' ',' ',' ',' ',' ',' ',' ','@',' ',' ',' ',' ',' ',' ',' ','@',' ',' ',' ',' ',' ',' ',' ','@'},
        {'@','@',' ',' ',' ',' ',' ',' ','@','@',' ',' ',' ',' ',' ',' ','@','@',' ',' ',' ',' ',' ',' ','@','@'},
        {'@',' ','@',' ',' ',' ',' ',' ','@',' ','@',' ',' ',' ',' ',' ','@',' ','@',' ',' ',' ',' ',' ','@',' ','@'},
        {'@','@','@','@',' ',' ',' ',' ','@','@','@','@',' ',' ',' ',' ','@','@','@','@',' ',' ',' ',' ','@','@','@','@'},
        {'@',' ',' ',' ','@',' ',' ',' ','@',' ',' ',' ','@',' ',' ',' ','@',' ',' ',' ','@',' ',' ',' ','@',' ',' ',' ','@'},
        {'@','@',' ',' ','@','@',' ',' ','@','@',' ',' ','@','@',' ',' ','@','@',' ',' ','@','@',' ',' ','@','@',' ',' ','@','@'},
        {'@',' ','@',' ','@',' ','@',' ','@',' ','@',' ','@',' ','@',' ','@',' ','@',' ','@',' ','@',' ','@',' ','@',' ','@',' ','@'},
        {'@','@','@','@','@','@','@','@','@','@','@','@','@','@','@','@','@','@','@','@','@','@','@','@','@','@','@','@','@','@','@','@'}
    };

  5. #5
    emceenugget is offline Senior Member
    Join Date
    Sep 2008
    Posts
    564
    Rep Power
    7

Similar Threads

  1. Multi dimensional Array
    By Preethi in forum New To Java
    Replies: 1
    Last Post: 07-09-2008, 04:34 PM
  2. How to reverse two dimensional
    By masaka in forum New To Java
    Replies: 4
    Last Post: 05-19-2008, 11:02 AM
  3. How to initialize a two dimensional Array
    By Java Tip in forum java.lang
    Replies: 0
    Last Post: 04-14-2008, 09:48 PM
  4. Adding numbers in a 2 dimensional array
    By j0shizabeast in forum New To Java
    Replies: 2
    Last Post: 11-27-2007, 05:31 AM
  5. Help with array multi-dimensional
    By barney in forum New To Java
    Replies: 1
    Last Post: 07-31-2007, 09:00 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •