Subscribe to Feeds

Send Your COMPLETED Projects To georgepj@hotmail.com

We'll Publish It With Your Name :-)

Programs Can Also Be Downloaded From The Folders Below....[Or Scroll Down]

Array in given pattern

Click Here To Download C++ File Of This Program

 /*  
4 3 2 1
0 3 2 1
0 0 2 1
0 0 0 1
*/
//Downloaded From www.c4cpp.co.nr
//(C)2009.All rights reserved.
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int i,n,g,j,a[100],b[100][100];
cout<<"Enter Limit"<<endl;
cin>>n;
cout<<"Enter "<<endl;
for(g=0;g<n;g++)
cin>>a[g];
for(i=0;i<n;i++)
{
for(j=n-1;j>=0;j--)
{
b[i][j]=a[j];
}
}
for(i=0;i<n;i++)
{
for(j=0;j<n;j++)
{
if(i>j)
b[i][j]=0;
}
}
for(i=0;i<n;i++)
{
cout<<endl;
for(j=0;j<n;j++)
{
cout<<b[i][j]<<" ";
}
}
getch();
}

No comments: