Re: Print Triangle inside a rectangle



unixdomain@xxxxxxxxx wrote:
Hello,
I want to print a triangle, made of blanks or asterics inside a
rectangle made of alphabets.
It's as follows;
ABCDEFGFEDCBA
ABCEEF FEDCBA
ABCDE EDCBA
ABCD DCBA
ABC CBA
AB BA
A A

It has 7 rows and 13 columns. I tried to implement like this;
do {
if(j == rows) //int j=0, int row=1

Why are the assignments to j and row in comments?

I can't just use use copy and paste to run your code, you're making it hard work for anyone who wants to help.

Read these:
http://homepage1.nifty.com/algafield/sscce.html
http://mindprod.com/jgloss/sscce.html


for(int c=0;c<arr.length;c++) //char
arr[]={'A','B','C','D','E','F','G','F','E',.....};

Those "...." don't look like valid Java.

Regularly posted to this newsgroup is a message on how to get the best out of it. It says

Before posting read Jon Skeet's "How to get answers on the
comp.lang.java.* newsgroups" at
http://www.pobox.com/~skeet/java/newsgroups.html


if(c==maxCol) //int maxCol=6;
arr[c]=b; //char b = ' ';
----------------------------------------------------
_FROM THIS POINT I CAN'T PROCEED!____________________________

Why not?
- do you get a compiler error message?
- do you get a run-time error?
- how does the output differ from what you want

for(blank=0;blank<maxBlank;blank++)
arr[blank]=b;
maxBlank+=2;
maxCol--;
row++;
j++;



}while(j<=6);


Plz help.


Here's what *not* to do
http://www.catb.org/~esr/faqs/smart-questions.html#homework

Here's how to solve this problem
http://home.earthlink.net/~patricia_shanahan/beginner.html

I'd try asking a more narrowly focused specific question.
.



Relevant Pages

  • Re: Playing Songs Or Vidoes
    ... all i can here when i turn the volume up is crackling. ... PLZ HELP ... Error message codes may be found searching there or via a general web search. ... Please deliver feedback to the newsgroup, so that others can be helped. ...
    (microsoft.public.windowsmedia.player)
  • Re: how to change font color in Macro?
    ... 2.Change font color of that lines. ... Dim prop As EnvDTE.FontsAndColorsItems = ... Plz help me dear friends... ... Wrong newsgroup and please don't multiple-post.- Hide quoted text - ...
    (microsoft.public.vb.general.discussion)
  • Re: satellite
    ... This is myseminar topic.so plz help me in seminar point of view. ... excuse me for my english. ... This newsgroup concerns "satellite navigation", ...
    (sci.geo.satellite-nav)
  • Add Newsgroups To Outlook 2003
    ... I Want To Add A Newsgroup To Microsoft Outlook 2003 But I dont Know How Can ... Any 1 Plz Help Me ...
    (microsoft.public.windowsxp.general)