Saturday, 10 December 2011

Write a program to print this Series in c

#include
#include
main()
{
int n,i,j;
clrscr();
for(i=1;i<=5;i++)
{
for(j=1;j<=i;j++)
{
printf("%d",j);
}
printf("\n");
}
getch();
}

OUTPUT
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5

No comments:

Post a Comment