#include<iostream>
using namespace std;
void main()
{
int n=1,c=4,l=1;
for(int i=1;i<=4;i++)
{
for(int j=1;j<=c;j++)
{
cout<<" ";
}
for(int k=1;k<=n;k++)
{
cout<<l<<" ";
l++;
}
cout<<endl;
c--;
n++;
}
}
Output:
1
2 3
4 5 6
7 8 9 10
using namespace std;
void main()
{
int n=1,c=4,l=1;
for(int i=1;i<=4;i++)
{
for(int j=1;j<=c;j++)
{
cout<<" ";
}
for(int k=1;k<=n;k++)
{
cout<<l<<" ";
l++;
}
cout<<endl;
c--;
n++;
}
}
Output:
1
2 3
4 5 6
7 8 9 10
No comments:
Post a Comment