Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

Pattern using recursion in Java

1234567891011121314151617181920212223242526
import java.lang.String;import java.util.Scanner;public class Main{    // function to print the required pattern    public static String func(int n) {        //write your code he        if(n<=0)        {            return "";        }            String res=func(n-1);            res=res+"*";            System.out.println(res);            return res;        }    public static void main(String[] args) {        Scanner in = new Scanner(System.in);        int n = in.nextInt();        func(n);    }}
Comment

PREVIOUS NEXT
Code Example
Java :: fibonacci java 
Java :: java create a hashmap 
Java :: Java @Target 
Java :: array erstellen java 
Java :: encode é to é java 
Java :: android studio clear child views 
Java :: java isalphanum 
Java :: jaggies 
Java :: system program j 
Java :: setCookie("showPopupBannerBeta", 1, 1 
Java :: check is element present in queue java 
Java :: Java Multiple element Annotations 
Java :: How to adjust layout when soft keyboard appears 
Java :: newinstance in java giving exception 
Java :: bukkit java get max players 
Java :: testng with cucumber 
Java :: query spring boot 
Java :: set preference value android 
Java :: extend vs implement in java 
Java :: Get the number of weeks between two dates 
Java :: Java Filters 
Java :: how to import borderlayout 
Java :: get my jre path 
Java :: local inner class in java 
Java :: get random word from xz file 
Sql :: how to get the size of the database in postgresql 
Sql :: guid to string sql 
Sql :: start postgresql 
Sql :: mysql 3 months ago 
Sql :: Cannot load driver class: com.mysql.cj.jdbc.Driver 
ADD CONTENT
Topic
Content
Source link
Name
8+8 =