Thursday, 21 February 2013

WAP to print Pascals Triangle

| |


#include<iostream>
#include<math.h>
using namespace std;

int main()
{
    int i,j,k,l,n,m;
    cout<<"Enter the number of rows :""\n";
    cin>>n;
   
    for(i=0;i<n;i++)
    {
                    cout<<"\n";
                    for(k=(n-i);k>0;k--)
                    { cout<<" ";}
                    if(i==0)
                    {
                            cout<<"*";
                            continue;}
                    if(i==(n-1))
                    {
                            for(j=0;j<((2*n)-1);j++)
                            { cout<<"*";}
                           
                    break;
                    }
                    cout<<"*";
                   
                    for(l=fabs(2*i-1);l>0;l--)
                    {
                                              cout<<" ";
                                              }
                    cout<<"*";
                    }
                   
                    cout<<"\n";
    system ("pause");
    return 0;
}
                   
 

WAP to print Pascals Triangle


Comments (2)

Loading... Logging you in...
  • Logged in as
VIKAS TOMAR's avatar

VIKAS TOMAR · 611 weeks ago

Dude, I want TURBO C++ 4.5 for Windows7 64bits. Can you send me the link or rather upload it to your website.
EMAIL - vicky34503@gmail.com
Thanks
VIKAS TOMAR (the one who lives in your street)
1 reply · active 611 weeks ago
Bro I Hav Uploaded It 4 U thnqs and Keep visiting ,
Link :
http://www.way2hack.org/2013/07/turbo-c-45-full-version-for-windows-7.html

Post a new comment

Comments by

Related Posts Plugin for WordPress, Blogger...
Powered by Blogger.