File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes java programming Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "java programming" Watch "java programming" New topic
Author

java programming

winny dhar
Greenhorn

Joined: Nov 14, 2011
Posts: 13
hello..
friends if i want to print numbers 1 to 100 without using loops what logic would be applied in this??
using loops to i can make but without i am not getting ..
Srinivas Reddy Mudimala
Greenhorn

Joined: Nov 17, 2011
Posts: 2
make use of label,break,continue and if keywords to get the output
Matthew Brown
Bartender

Joined: Apr 06, 2010
Posts: 4338
    
    7

Other than the obvious (100 separate print statements ), assuming this is an exercise it's probably looking for you to use a recursive method (i.e. a method that calls itself).
winny dhar
Greenhorn

Joined: Nov 14, 2011
Posts: 13
thanku.. ya i got it using recursion..
Miku Ranjan
Ranch Hand

Joined: Oct 11, 2011
Posts: 98
Hi,
Make one method with you print statement and call it recursively it till a flag value is 100
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 37874
    
  22
Welcome to the Ranch
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 11145
    
  16

Matthew Brown wrote:Other than the obvious (100 separate print statements )

amateur...I can do it with one print statement.

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java programming
 
Similar Threads
Problems with threads, PLEASE IGNORE MY PREVIOUS TOPICS
Please help me write this method!
Convert String [] to ArrayList<Long> ()
How to print a String with out duplicates
Removing specific character from the given String