Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Nishant Jain
Description
1 Answer(s)      3 years and 7 months ago
Posted in : Java Beginners


public class PatternExample{ public static void main(String[] args){

int i,j,n=5;

for(i=0;i<=n;i++) { System.out.println(); for(j=1;j<=n-i;j++) System.out.print(j); for(j=0;j<2*i;j++) System.out.print(" "); for(j=n-i;j>0;j--) System.out.print(j); } } } OUTPUT IS

1234554321 1234 4321 123 321 12 21 1 1

PLZ DESCRIBE ME THAT HOW TO MAKE THIS PROGRAM AND WHATS THE WORKING OF EVERY LOOP


Advertisement
View Answers

February 25, 2011 at 3:38 PM


The above code consists of four loops. The first loops create the five rows. The second loop first increment the value of j by decrement the value of n. The third loop provides the incremented space. The fourth loop first decrement the value of j.



Related Tutorials/Questions & Answers:
Advertisements
full description of program code
full description of program code  import java.util.*; class StringExample6 { public static void main(String[] args) { Scanner input.... i've a problem that plz describe me full description of this code thanks
full description of program code
full description of program code  import java.util.*; class StringExample6 { public static void main(String[] args) { Scanner input.... This is the full description for your second output
full description of program code
full description of program code  escribe me below code how this program code is make and work, and those method is use in this why? import java.util.*; class SortList { public static void main(String[]args) { Scanner input=new
how to get description for each file
how to get description for each file  hi, how to get description... file if the user select 10 file to upload........get the description for each file without description dont upload..... u have any idea......code
Website Description Data Scraper & Image/Thumbnail Generator
Website Description Data Scraper & Image/Thumbnail Generator   I need Image/Thumbnail Generator code in java. Please help me
Website Description Data Scraper & Image/Thumbnail Generator
Website Description Data Scraper & Image/Thumbnail Generator   This is yhoo I need Image/Thumbnail Generator code in java. Please help me
Match EJB roles with the corresponding description of the role's responsibilities, where the description may include deployment descriptor information.
with the corresponding description of the role's responsibilities, where the description... with the corresponding description of the role's responsibilities, where the description may include deployment descriptor information. There are 6
description about jdk 1.5 features - Hibernate Interview Questions
description about jdk 1.5 features  Hi. Please can anyone provide the details description regarding the new features available in jdk 1.5....  Hi friend, JDK : JDK is a software development program provided
java code for accept city name and gives temparature,wind speed,humidity exts along with description
java code for accept city name and gives temparature,wind speed,humidity exts along with description  java code for accept city name and gives temparature,wind speed,humidity exts along with description
Match the correct description about purpose and function to which session bean type they apply: stateless, stateful, or both.
Match the correct description about purpose and function to which session bean type they apply: stateless, stateful, or both. Prev ...;   Match the correct description about purpose and function
Description of Database Table
Description of Database Table     ... or not, whether the column is unique or primary and much more. Description... the detail description of table. When the program will gets execute then it will show
Description of EJB 3
Description of EJB 3     Enterprise beans are the Java EE server side components that run inside the ejb container and encapsulate the business logic of an enterprise application. EJB3
Description of GlassFish Application Server
Description of GlassFish Application Server     GlassFish is a free, open source application server that implements the newest features in the Java EE 5 platform. The Java EE 5 platform includes
Match the name with a description of purpose or functionality, for each of the following deployment descriptor elements: ejb-name, abstract-schema-name, ejb-relation, ejb-relat
Match the name with a description of purpose or functionality, for each of the following deployment descriptor elements: ejb-name...) Next     Match the name with a description of purpose
Technical description of Java Mail API
Technical description of Java Mail API       This section introduces you with the core concepts of Java Mail API. You must understand the Java Mail API before actually delving
Collection : LinkedList Example
This tutorial contains description of Collection LinkedList with example
Collection : ArrayList Example
This tutorial contains description of Collection ArrayList with example
Hibernate Caching
This tutorial contains description about Hibernate Caching
Hibernate : Dynamic-insert
This tutorial contains description of Hibernate dynamic-insert
Hibernate Session Load
This section contain description of Hibernate session load
Hibernate :Clear Session ,Close Session
This part contains description of Hibernate session.clear() and session.close.
Hibernate Date Format
This section contains description of Hibernate Date Format
Hibernate Named Query
This section contain description of named query with example
Hibernate Life Cycle
This tutorial contains full description of Hibernate life cycle
Ordering of web fragments
This section contains the detailed description on Ordering of web fragments
Java Collection : LinkedHashSet Example
Java Collection : LinkedHashSet Example This tutorial contains description of LinkedHashSet with example. LinkedHashSet : LinkedHashSet class is defined...()); System.out.println("LinkedHashSet elemnts : "+set); } } Description
Advertisements
 

 

 

DMCA.com