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();
}
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();
}
its very difficult to understand ur logic
ReplyDeleteits very difficult to understand ur logic
ReplyDeleteI Have Posted a new Logic And With its Mirror Image Coding..
ReplyDeleteChekout Its Updates