Pages

Sunday, 20 May 2012

program to print this series


61./*Write a program to print this series.*/

#include<stdio.h>
#include<conio.h>
main()
{
int n,i,j;
clrscr();
printf("Enter How Many Lines You Want:");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
for(j=1;j<=i;j++)
{
printf("%d",i);
}
printf("\n");
}
getch();
}

OUTPUT
            Enter How Many Lines You Want:5
            1
            2 2
            3 3 3
            4 4 4 4
            5 5 5 5 5

No comments:

Post a Comment