New Member FAQ
|
Forums
|
Earn Revenue
Resources
Entrance
Ask Experts
Exam Papers
Jobs
English
Projects
Universities
Colleges
Courses
Schools
Training
My India
Members
|
Communities
|
Business Directory
|
Classifieds
|
Reviews
|
Silverlight Games
|
Peer Appraisal
|
Bookmarks
|
Polls
|
Mentors
|
Links
|
Academic Projects
|
Lobby
|
Gift Shop
|
Chat
My Profile
Sign In
Register
AdSense Revenue
Active Members
Today
N K Ravishanka...
(50)
sridevi
(37)
Agnes Mary
(30)
Last 7 Days
Mr. Anindya
(2274)
PROSENJIT MANN...
(2013)
Pawan Bahuguna
(1251)
more...
Awards & Gifts
Online Exams
Aptitude Questions
General Aptitude Tests
Medical Entrance
Engineering Entrance
Bank Tests
TOEFL & IELTS Questions
Fresher Jobs
Our fresher job section is exclusively for fresh graduates! Find jobs for freshers in major Indian cities including Bangalore, Chennai, Hyderabad, Pune or Kochi
Resources
Find educational articles, blogs, discussion threads and other resources.
Colleges
Find details about any college in India or search for courses.
Program to construct a pascal triangle
Posted Date: Total Responses:
0
Posted By:
hasmukh
Member Level:
Bronze
Points/Cash
: 2
class Pascal
{
public static void main(String args[])
{
int a[][]=new int[5][];
a[0]=new int[2];
a[0][0]=1;
a[0][1]=1;
for(int i=1;i<5;i++)
{
a[i]= new int[i+2];
a[i][0]=1;
a[i][i+1]=1;
for(int j=1;j
{
a[i][j]=a[i-1][j-1]+a[i-1][j];
}
}
System.out.println(" 1");
for(int i=1;i<5;i++)
{
for( int p=5-i;p>0;p--)
{
System.out.print(" ");
}
for(int j=0;j
{
System.out.print(" "+a[i][j]+" ");
}
System.out.println();
}
}
}
OUTPUT:
1
1 2 1
1 3 3 1
1 4 6 4 1
1 5 10 10 5 1
Project Feedbacks
No feedbacks found. Be the first to respond and make money from
revenue sharing program
.
Post Feedback
You must
Sign In
to post a feedback.
Next Project:
Program to accept a arguments from command line in java
Previous Project:
To create Bank software using Java
Return to Project Index
Post New Project
Related Projects
SYMBOL TABLE USING C
Java program to make frequency count of words in a given text.
Get the current time
MFC-Modal dialog box
RUN TIME STORAGE MANAGEMENT
Advertise Here
Contact Us
Advertise
Editors
Privacy Policy
Terms Of Use
ISC Technologies.
2006 - 2009 All Rights Reserved.