• Post Reply Bookmark Topic Watch Topic
  • New Topic

Printing a triangle  RSS feed

 
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
author
Marshal
Posts: 23440
138
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
 
Rancher
Posts: 425
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.
 
Marshal
Posts: 58454
178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
People have said enough about not giving solutions, I think.

Vivek Alampally, how far have you got?
 
Vivek Alampally
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 470
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could use http://faq.javaranch.com/java/UseCodeTags

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!