what is the logic of this pattern?

what is the logic of this pattern?

                                          1
                                         121  
                                        12321
                                       1234321
                                      123454321
View Answers

July 27, 2011 at 9:29 PM

this is my code.. use string and array:P

public class pattern_ { public static void main(String args[]) {int a[]={1,2,3,4,5}; String S=""; String S1=""; String space=" ";//use a for loop in case of user inputs to create this string int j=5;//space length for(int i=0;i


March 22, 2012 at 2:09 PM

class NumberPattern{ public static void main(String[] args) { int k; for(int i=1;i<=5;i++) { for(int j=5;j>i;j--) { System.out.print(" "); } for(k=1;k<=i;k++) { System.out.print(k); } --k; for(int l=--k;l>=1;l--) { System.out.print(l); } System.out.println(); }

}

}









Related Tutorials/Questions & Answers:
What is programming logic ?
what is the logic of this pattern?
Advertisements
what's the logic for create pattern program
ModuleNotFoundError: No module named 'pattern3'
ModuleNotFoundError: No module named 'pattern3'
ModuleNotFoundError: No module named 'pattern3'
ModuleNotFoundError: No module named 'pattern3'
patterns
LOGIC
LOGIC
Design patterns interview questions1
Patterns
delete retailer jsp file (sir..is this a good logic.. jsp file is useful for what purpose)
design patterns are used in Struts?
Business logic vs Presentation logic - JSP-Servlet
Logic and desgin
Logic Building
PHP Design Patterns
AJAX Patterns
Logic Iterate.
Logic Iterate.
design patterns - Java Beginners
patterns
patterns
patterns
patterns
Patterns
Business Logic in mvc2 - JSP-Servlet
struts logic tags
ModuleNotFoundError: No module named 'patterns'
ModuleNotFoundError: No module named 'patterns'
ModuleNotFoundError: No module named 'patterns'
About desing patterns - Struts
Logic and Degin
Logic and Design
logic-iterate
Design Patterns
Design patterns interview questions3
logic for pattern program
WEB LOGIC - JSP-Servlet
the business logic is executed.
Java - Design concepts & design patterns
J2EE design patterns - Design concepts & design patterns
Creational Patterns
ModuleNotFoundError: No module named 'logic'
Design patterns in ejb - EJB
Design patterns - Design concepts & design patterns
Behavioral Patterns
Structural Patterns
Version of com.ft>functional-patterns dependency

Ads