COMMENTS-:THIS PROGRAM PRINT SERIES AS
1
1 2
1 2 3
1 2 3 4
PROGRAM-:
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int i,j,n;
cout<<"enterthe value of n";
cin>>n;
for(i=1;i<=n;i++)
{
cout<<"\n";
for(j=1;j<=i;j++)
{
cout<<j;
}
}
getch();
}
1
1 2
1 2 3
1 2 3 4
PROGRAM-:
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int i,j,n;
cout<<"enterthe value of n";
cin>>n;
for(i=1;i<=n;i++)
{
cout<<"\n";
for(j=1;j<=i;j++)
{
cout<<j;
}
}
getch();
}
0 comments:
Post a Comment