Followers

Wednesday, March 14, 2012

TRIANGLE OF NUMBERS

#include<iostream.h>
#include<conio.h>

void main()
{
 clrscr();
 int n;
 cout<<"enter the number of lines :";
 cin>>n;
 for(int i=1 ; i<=n ; i++)
 {
   for(int j=1; j<=i ; j++)
     cout<<(0+j);
   cout<<"\n";
 }
 getch();
}
.................................................................
OUTPUT :(click to enlarge the image)

No comments:

Post a Comment