Skip to content

Commit c685598

Browse files
Number Triangle #88
1 parent 76a0d19 commit c685598

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

NumberTriangle.cpp

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#include <iostream>
2+
using namespace std;
3+
int main()
4+
{
5+
int i,j,k,l,n;
6+
cout<<"Enter the Range=";
7+
cin>>n;
8+
for(i=1;i<=n;i++)
9+
{
10+
for(j=1;j<=n-i;j++)
11+
{
12+
cout<<" ";
13+
}
14+
for(k=1;k<=i;k++)
15+
{
16+
cout<<k;
17+
}
18+
for(l=i-1;l>=1;l--)
19+
{
20+
cout<<l;
21+
}
22+
cout<<"\n";
23+
}
24+
return 0;
25+
}

0 commit comments

Comments
 (0)