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
|
B.Tech Projects
|
Lobby
|
Gift Shop
|
Chat
My Profile
Sign In
Register
AdSense Revenue
Active Members
Today
Lenin
(570)
Rajesh
(278)
Ketan Aagja
(176)
Last 7 Days
Dr.Sanjeev(San...
(3427)
Lenin
(1842)
Mahesh
(1472)
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
Conditional oprearation detector in C Sharp
RBT Implementation without deletion in C++
WIRELESS INTRUSION DETECTION SYSTEM
Time Server
servletexample
Advertise Here
Watch TV Channels
Watch Asianet online
Kairali TV in Internet
Surya TV online
Amritha TV Channel
Contact Us
Advertise
Editors
Privacy Policy
Terms Of Use
ISC Technologies.
2006 - 2009 All Rights Reserved.