PROGRAM ON PATTERN 5


                                                                                 *
                                                                                * *
                                                                               * * *
                                                                              * * * *
                                                                             * * * * *
#include<iostream.h>
#include<conio.h>
#include<stdio.h>
Void main()
{
     int i,space,n,k=0;
     clrscr();
     cout<<”Enter the no. of rows:”;
     cin>>n;
     for(i=1;i<=n;i++)
     {
         for(space=1;space<=n-i;i++)
         {
                cout<<”  ”;
          }
          for(k=0;k!=2*i-1;k++)
          {
               cout<<”*”;
          }
          k=0;
          cout<<”\n”;
      }
        getch();

  }

Comments

Popular Posts