Saturday 10 December 2011

Write a program to print same number series in c

#include
#include
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