+ 2

Challenge#^:

Write a program to print number from 1 to 10 or how much u want in java without using loop. Be creative and think of it. BEST OF LUCK. HAPPY CODING😄😄😇

23rd Jan 2018, 9:14 AM
Anjali Kushwaha
Anjali  Kushwaha - avatar
4 odpowiedzi
+ 17
public class Program{ static int y=1; public static void main(String[] args){ returnPat(10);} static void returnPat(int k){ if(k>=y){System.out.print(y++);returnPat(k);}} } /*is recursion allowed ? , if its allowed then its too simple challenge else i'll try later & think some idea to do it without loop ☺*/ //or System.out.print ("12345678910"); //without loop 😂
23rd Jan 2018, 11:34 AM
Gaurav Agrawal
Gaurav Agrawal - avatar
+ 1
okay u can take ur time we'll it's easy I know but it will test ur creativity and fundamental well I'm working on it.. Thank u ur inspirational u never lose lose and very active in taking up challenges
23rd Jan 2018, 12:39 PM
Anjali Kushwaha
Anjali  Kushwaha - avatar
0
hello, so any one for a real challenge
23rd Jan 2018, 11:05 AM
Anjali Kushwaha
Anjali  Kushwaha - avatar