Question

Write a triangle shape using Java for the letter capital T like the one in the image, and no loop is requiered, please help with the codeTIIT

0 0
Add a comment Improve this question Transcribed image text
Answer #1

the program is --

class AtriangleB{
  
   public static void main(String args[])
   {
      
       System.out.println(" T");
       System.out.println(" TTT");
       System.out.println(" TTTTT");
       System.out.println(" TTTTTTT");
       System.out.println(" TTTTTTTTT");
       System.out.println(" TTTTTTTTTTT");
       System.out.println("TTTTTTTTTTTTT");
  
      
   }

}

and the output is-

C:\Users\Aditya kumar\Desktop> javac -d . AtriangleB.ja va C:\Users\Aditya kumar\Desktop> java AtriangleB.triangle TTT TTTTT

we can do the same thing with the help of for loop but as you mention not required for the loop.. so this is simplest way to design a Tree by using capital T

Add a comment
Know the answer?
Add Answer to:
Write a triangle shape using Java for the letter capital T like the one in the...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT