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();


  }



3 comments:

  1. its very difficult to understand ur logic

    ReplyDelete
  2. its very difficult to understand ur logic

    ReplyDelete
  3. I Have Posted a new Logic And With its Mirror Image Coding..

    Chekout Its Updates

    ReplyDelete