Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

number pattern in java

import java.util.Scanner;
 
public class MainClass
{
    public static void main(String[] args) 
    {
        Scanner sc = new Scanner(System.in);
         
        System.out.println("How many rows you want in this pattern?");
         
        int rows = sc.nextInt();
         
        System.out.println("Here is your pattern....!!!");

        for(int i=1;i< rows+1 ;i++)
        {
            for(int j=i; j < rows+1 ;j++)
            {
                System.out.print(j + " ");
            }
            for(int k=1; k < i ;k++)
            {
                System.out.print(k + " ");
            }
            System.out.println();
        }
        
        sc.close();
    }
}
Comment

PREVIOUS NEXT
Code Example
Java :: java lexographic 
Java :: decision tree drools using spring boot 
Java :: java was started but returned exit code=13 
Java :: search in jdbc 
Java :: Quartz spring maven driver 
Java :: jadoh meaning 
Java :: Lists - removing 
Java :: string join in java 
Java :: accessdeniedexception amplify init 
Java :: void add method using collections 
Java :: read properties file outside jar java 
Java :: boxing and unboxing in java pdf 
Java :: Java Creating strings using the new keyword 
Java :: how to convert string to space separated int in java 
Java :: sudo visudo quit without saving 
Java :: detecting battery charging android 
Java :: What is the name of the Android function that is used to update the UI (user interface) from a background thread? 
Java :: how to get listview data, TextView 
Java :: .int x=5; final int y=7; x=x+10; y=y+10; 
Java :: javax.ws.rs.core.response readentity not found 
Java :: reference to an instance method of an arbitrary object of a particular type 
Java :: priority queue size jaa 
Java :: java running sum 
Java :: add pd4j to application 
Java :: java get current method name 
Java :: Java Floating-point Literals 
Java :: ArrayList go to value jav 
Java :: bluetooth chat example android server 
Java :: ratespiel java 
Java :: @android:color/system_neutral1_1000 
ADD CONTENT
Topic
Content
Source link
Name
3+5 =