Showing posts with label parinting array. Show all posts
Showing posts with label parinting array. Show all posts

Saturday, 20 February 2016

Program To Print Array in the As "Asterisk"
By Column in C++

"Nice One Program"














#include<iostream.h>
#include<conio.h>
void main()
{
  clrscr();
  int a[6]={5,6,9,2,4,3};
  int i,j;

  char p[9][6];

  for(i=0;i<6;i++)
  for(j=0;j<9;j++)
{ if(j<(9-a[i]))
  p[j][i]='\0';
  else
  p[j][i]='*';

}

  for(j=0;j<9;j++)
 { cout<<endl;
  for(i=0;i<6;i++)
  cout<<p[j][i];

  }

  getch();


  }