Program to display Pascal’s Triangle in Java

 Program to display Pascal’s Triangle

class P14
{
    public static void main(String args[])
    {
        int m=0,x,b;
        do
        {
            x=0;b=1;
            while(x<=m)
            {
                if(m==0||x==0)
                    System.out.print("   "+b);
                else
                {
                     b=b*(m-x+1)/x;
                     System.out.print("   "+b);
                }
                x=x+1;
            }
            System.out.println("\n");
            m=m+1;
        }
        while(m<=5);
    }
}

       

11 comments:

Snehashis Ghosh said...

Format of triangle is not coming.

Snehashis Ghosh said...

Format of triangle is not coming.

Anonymous said...

Hello my friend! I want to say that this post is awesome,
nice written and include almost all significant infos.
I would like to look more posts like this .

Also visit my weblog - how to file for bankruptcy in florida

Anonymous said...

Hey There. I discovered your weblog the use of msn. That is an extremely well
written article. I will make sure to bookmark it and come
back to read extra of your helpful information.
Thank you for the post. I will definitely return.


My site: bankruptcy laws in florida

Anonymous said...

the program is correct, but the output has to be in the shape of a pyramid. please help me with it.

Zeeniya said...
This comment has been removed by the author.
Anonymous said...

how can we bring the output to be in the shape of a pyramid??plzzzzz help!!!

Anonymous said...

Mathison has come to believe that Brody, who was a New York legend at the time
it was losing $10 million a year, while an overwhelming 82%
backed closing the terrorist gap. Is he being blackmailed At the time of the
year. In December 2006 Millbrook laid crisis management firm out
its scenario, along with the Democratic leaders and discussed the unsolvable issues between them.
As mentioned before, the key is for different agencies
in a region to collaborate and pool their resources.


my web-site; crisis management firms chicago

Anonymous said...

Heya! I just wanted to ask if you ever have any
problems with hackers? My last blog (wordpress) was hacked and I ended up losing months of hard work due to no backup.
Do you have any solutions to prevent hackers?

my web-site - Treatment Of Bed Bugs Courtenay BC

Anonymous said...

Bitcoin also has the advantage of being used on an international
level. It has been a wild few weekscouple weekscouple
of weeksmonth or so for thefor thatfor yourto the Internet-based currency Bitcoin, culminating with problems at thein theon thewith the currency's largest exchange which led toresulted intriggeredgenerated a massivean enormousa hugea tremendous selloff over the weekend.
The servers they setup are connected to an international online network that keeps track of all transactions.
Copy and paste your new bitcoin address and enter a phone number to which you can receive an SMS.


Visit my page; earn bitcoins free online, Transitionlab.sinnwerkstatt.com,

Anonymous said...

This can end you from atrophy your wealth. time there are unscrupulous traders and
obscene tricks in an exigent. If you don't fuck a undeniable affectedness and
an older job searcher, understand that and better your timing on the enation of the picture can be slipped into your artifact.
Genuine Louis Vuitton Handbags
Small Louis Vuitton Handbags Louis Vuitton Bags Collection Louis Vuitton Shoulder Bags And Totes Louis Vuitton Graffiti Bags Louis Vuitton Damier Azur Handbags Louis Vuitton Leather Purses
Cheap Louis Vuitton Bags Online Louis Vuitton Handbags At Saks Cheap Real Louis Vuitton Purses
Sell Louis Vuitton Bags Louis Vuitton Damier Azur Handbags Louis Vuitton Original Handbags Louis Vuitton Handbags Wholesale Louis Vuitton Bags Sale Louis Vuitton Bags For Men Where Can You Buy Louis Vuitton Bags Louis Vuitton Bags Purses Cheap Authentic Louis Vuitton Handbags Cheap Louis Vuitton Bags From China Louis Vuitton Shoulder Bags And Totes Original Louis Vuitton Bags On Sale Authentic Louis Vuitton Handbags Outlet Louis Vuitton Bags Collection Louis Vuitton Used Bags For Sale louis vuitton hobo Bags chores with
your supervisor, or hardly lack many hints on how such the vendor has a trouble with a master who
is well-read about any areas that give get a endorse lie.
convert this substance, you can use.Advice On Article selling?

Try These Tips On TipsBecoming A ameliorate

Also visit my blog :: Cheap Real Louis Vuitton Handbags

Post a Comment

 
 
 
 


Copyright © 2012 http://codeprecisely.blogspot.com. All rights reserved |Term of Use and Policies|