aspose file tools*
The moose likes Beginning Java and the fly likes Printing a triangle Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Printing a triangle" Watch "Printing a triangle" New topic
Author

Printing a triangle

Vivek Alampally
Ranch Hand

Joined: Jul 10, 2008
Posts: 67
I am trying to a write a program which prints a triangle as shown below
*
**
***
****
*****
Can anybody tell me how to do it in java?
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10372
    
    8

If you are looking for a ready made solution, you are at the wrong place.
Show us what you have got so far, tell us where you are stuck and we will help point you in the right direction


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18834
    
  40


Generally, starting with what you just learned is a good idea. I am assuming that you just learned about loops prior to this homework assignment. Start from there...

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Pushkar Choudhary
Rancher

Joined: May 21, 2006
Posts: 425

Vivek Alampally wrote:Can anybody tell me how to do it in java?

In case you are not sure why Maneesh is saying:
Maneesh Godbole wrote:If you are looking for a ready made solution, you are at the wrong place.

read this and this.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38818
    
  23
People have said enough about not giving solutions, I think.

Vivek Alampally, how far have you got?
Vivek Alampally
Ranch Hand

Joined: Jul 10, 2008
Posts: 67
Actually I wanted to print a different triangle(Here at the time of posting, forum editor is eliminating all the spaces) . But it is not possible here to show you all what I actually wanted to print
Misha Ver
Ranch Hand

Joined: Mar 03, 2008
Posts: 470
You could use http://faq.javaranch.com/java/UseCodeTags

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Printing a triangle