please help me to write a code for this program

please help me to write a code for this program

                 1
             1       1
           1   2   2    1
         1   3   4    3    1
       1   4   7    7   4    1
View Answers

May 9, 2012 at 12:04 PM

Java Pyramid

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

        int a[][]=new int[15][15];
        int num = 25 ;

        for(int i = 0; i < 5; i++){
               for (int k = num - 2 * i; k >= 0; k--)
                     System.out.print(" ");
               for (int j = 0; j <= i; j++) {
                     if (j == 0 || i == j) {
                         a[i][j] = 1;
                     }
                     else {
                         a[i][j] = a[i - 1][j - 1] + a[i - 1][j];
                     }
                      System.out.printf("%4d", a[i][j]);
               }
                System.out.println();
         }
     }
}









Related Tutorials/Questions & Answers:
please help me to write a code for this program
please help me to write a code for this program   1 1 1 1 2 2 1 1 3 4 3 1 1 4 7 7 4 1
please help me to write a code for this program
please help me to write a code for this program   1 1 1 1 2 1 1 3 3 1 1 4 6 4 1
Advertisements
please any one can help me to write a code for this question?
please any one can help me to write a code for this question?  Q 1) In a class first day 25 students are joined. After two days that total students will increased to 60. We can develop a program by using ArrayList concept
please any one can help me to write a code for this question?
please any one can help me to write a code for this question?  1) Copy one file content to other? 2) Count the number of words in a file
Please help me to write a code for add contacts to groups in a website?
Please help me to write a code for add contacts to groups in a website?   Iam developing a site. In that site I need to write code for Groups... send a code for this? Please make it fast
plz help me out with this problem...please write the program for me.thanxxxxx
plz help me out with this problem...please write the program for me.thanxxxxx  Write a program that will print out a hydro bill. The bill... will be entered by the user: - Account number (12 digit code) - Address - Kilowatts used
plz help me out with this problem...please write the program for me.thanxxxxx
plz help me out with this problem...please write the program for me.thanxxxxx  Write a program that will print out a hydro bill. The bill... will be entered by the user: - Account number (12 digit code) - Address - Kilowatts used
please help me in coding this given program
please help me in coding this given program  consider the below... are the prime numbers in ascending order write a program to find the nth term in this series. (i m unable to code this program..please provide solution
please help me in coding this given program
please help me in coding this given program  consider the below... are the prime numbers in ascending order write a program to find the nth term in this series. (i m unable to code this program..please provide solution
PLEASE Help me write a Java program which will store, manipulate, and print student registration information.
PLEASE Help me write a Java program which will store, manipulate, and print..., ADDRESS AND ADMISSIONS CLASS PLEASE HELP!!! Write a Java program which... - street, city, state, and zip code. (c) Date is a predefined class
please help me for this program - Java Beginners
please help me for this program   Write a program that asks the user for a starting value and an ending value and then writes all the integers... 11 12 13 14   Hi Friend, Try the following code: import
please help me to give code - Java Beginners
please help me to give code  Write a function with a signature cheerlead(word) that prints a typical cheer as follows. The word robot: Gimme an R Gimme an O Gimme a B Gimme an O Gimme a T What did you give me? ROBOT
please help me to give code - Java Beginners
please help me to give code  Write a function, sliding(word, num)that behaves as follows. It should print out each slice of the original word having length num, aligned vertically as shown below. A call to sliding(examples, 4
please help me to give code - Java Beginners
please help me to give code  Write a program that uses loops to generate an n x n times table. The program should get n from the user. As a model here is a 4 x4 version: | 1 2 3 4
please help me to give code - Java Beginners
please help me to give code  Write a program that prints an n-level stair case made of text. The user should choose the text character and the number of stairs in the stair case * ** *** ****   Hi friend
Help me to write this simple java frame program
Help me to write this simple java frame program   I want to write a Java program for.... To create a frame with 4 text fields;name,street,city and pin;with suitable labels. Also add a button "OK". After enter values
please help me to give code - Java Beginners
please help me to give code  Write a program that reads a file named famous.txt and prints out the line with the longest length. In the case... John von Neumann Donald Knuth Charles Babbage Grace Hopper your program should
please help me in a java program !! - Java Beginners
please help me in a java program !!  the porgram should use...://en.wikipedia.org/wiki/Kosaraju_algorithm) there are 4 classes in my program : Vertex... and run the program" i still need to modify the method kosaraju in the class Graph
Please help me fix this code - MobileApplications
Please help me fix this code   Please help me in this area of code... in the background of the forms in this code i want to sum all expenses amount... expenses)", "Please fill all required field \n \n * This signify required field
Please write code for this program in java and Explain it ? pl'sssssssss
Please write code for this program in java and Explain it ? pl'sssssssss ... that were ever alive at one time. Write a method to compute this, given the above array of 2n integers. Write one of the following methods: C/C++: int
please help me to this problem..
please help me to this problem..  i wrote a program like keyboard and i used [JTextFiled] means that just you can write inside the program (i.e inside the JTextField) but i want to make this program to let me write where i
Please help me to modify my java code from php code
]; } } I tried like this (see below JSP code) ... but this is not giving me the exact result as the above PHP code is giving. So please help me to convert...Modify Java code from PHP Code  i want to covert this php code int
help me please
help me please   Hello I want helping for this question , Please Write a program that reads some friendsââ?¬â?¢ names, stores them in an array, and then prints out on the screen all friends who start by a particular letter
Please help me to modify my java code from php code
Please help me to modify my java code from php code  i want to covert...) ... but this is not giving me the exact result as the above PHP code is giving. So please... same, as they alter it before. Please help me on this topic "how to order rows
please help me.
please help me.  Please send me a code of template in opencms and its procedure.so i can implement the code. Thanks trinath
how can i write this program ?please suggest me
how can i write this program ?please suggest me  Program to calculate the sum of two big numbers (the numbers can contain more than 1000 digits). Don't use any library classes or methods (BigInteger etc
please help me
please help me  Dear sir, I have a problem. How to write JSP coding... before. This name list should get from the database. Please help me. By the way, I'm using access database and jsp code. Thank you
urgent...pleAse help me.....please!
urgent...pleAse help me.....please!  please help me urgent! how can i do dictionary with the use of array code in java, where i will type the word then the corresponding meaning for that word will appear...thanks
please help me to overcome this problem
please help me to overcome this problem  how to make it easy to write java code. can u please give me suggestions
please help me...
please help me...  write an application that print number in the following order using a FOR-Loop 1 2 3 4 5 2 4 6 8 10 3 6 9 1215 4 8 121620 5 10152025
Getting Exception on UseDefinedException sample program - Please help me how to resolve
Getting Exception on UseDefinedException sample program - Please help me how...); } } } Hi, I tried above code but getting Exception : MyException cannot...(test1.java:34) what is MyException and how it called ..please explain
please help me.
please help me.  How to read a properties file in java with a suitable example. Please send me. Thanks Trinath   Please visit the following link: Java read properties file
please help me.
please help me.  Please send me the validation of this below link. the link is http://www.roseindia.net/answers/viewqa/JSP-Servlet/9584-JSP-Servlet-Search-and-Edit.html Thanks Trinath
please help me.
please help me.  How to move the edits.jsp in below link? http://www.roseindia.net/answers/viewqa/JSP-Servlet/9584-JSP-Servlet-Search-and-Edit.html
Please help me.
Please help me.  Hi i am trinath in below there is a url.In that url there is a code of edit a jsp page.I understand that code but only one thing i not get it i.e; What is the work of "id".and what is the data type of id? http
please help me?
please help me?  Define a class named Circle with the following... is circumference. Use the constant PI value for the calculation. Write another class named TestCircle to test the Circle program by creating two Circle objects
please help me.
please help me.  I have a jsp page under that i add a list box under i get the countries through my database. so how can i do
this is my javascript code and i am not understanding the mistake in this,please help me?
this is my javascript code and i am not understanding the mistake in this,please help me?  <html> <h2>Form Validation</h2>...; if((nn1.value==null)||(nn1.value=="")){ alert("Please Enter
Please help me
Please help me  program for when a user enter his card number, it has to create default security pin in the database
I need help on my Java code.... please please help me out!?
I need help on my Java code.... please please help me out!?  Well my code is supposed to ask for an input file and then (ex: input.txt), read... the anagram on screen or the output file! Please show me whats wrong. Thanks i
please help me.
please help me.  I have three table in mysql,and i hava create a excel sheet and add this sheet.but my question is in every sheet i can display one one table result.how can i do
please help me in these prog
please help me in these prog   create 2 jdbc programs including awt create 2 jdbc programs including swing create 2 jdbc programs including command line argument create 2 jdbc programs including io class 4 jdbc prog using
Please help me
Please help me  Hi Sir, please send me the code for the following progrems... 1) all sets are integer type: input: set1={10,20,30,40} set2={15,25,35} output: union={10,15,20,25,30,35,40} 2) input: "Hi what
help me please
help me please  how can i do dictionary with the use of array code in java, where i will type the word then the corresponding meaning for that word will appear...thanks
please help me here
please help me here  please show me how can this show the right output that i need please continue doing this program using only if else and do while please please" here is the problem Automatic Teller Machine [B] Balance [D
please help me here
please help me here  please show me how can this show the right output that i need please continue doing this program using only if else and do while please please" here is the problem Automatic Teller Machine [B] Balance [D
Please help me urgent...........
Please help me urgent...........  For what kind of a problem would use a Tree Set and not a Tree Map For what kind of a problem would use a Tree Map and not a Tree Set   Hello Friend,ADS_TO_REPLACE_1 If you want
please help me
please help me  interface Test1 { String toString(); } public class Test { public static void main(String[] args) { System.out.println(new Test1() { public String toString() { return "test
Please help me??
Please help me??  Question_1: Using one-dimension array of primitive type elements. Objective: The purpose of this lab exercise is to practice how to declare, create and manipulate a one-dimension array of primitive type
Please help me out
Please help me out    Description* You are hired to develop a laptop inventory information system for Sheridan College in order to keep track of the information about the laptops lent to the students. Users can add or remove data

Ads