55-2

#include<iostream.h>
#include<conio.h>
void main()
{
                int i,j,k,n;
                clrscr();
                cout<<"Enter The Length of pattern :- ";
                cin>>n;
                for(i=1;i<=n;i++)
                                {
                                cout<<endl;
                                for(k=1;k<=n-i;k++)
                                                {
                                                cout<<" ";
                                                }
                                for(j=1;j<=i;j++)
                                                {
                                                cout<<j<<" ";
                                                }
                                }
                getch();
}

55

Advertisements