| 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: 3795
|
|
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: 32712
|
|
Welcome to the Ranch
|
 |
fred rosenberger
lowercase baba
Bartender
Joined: Oct 02, 2003
Posts: 9956
|
|
Matthew Brown wrote:Other than the obvious (100 separate print statements  )
amateur...I can do it with one print statement.
|
 |
 |
|
|
subject: java programming
|
|
|