Header Ads Widget

Ticker

6/recent/ticker-posts

WAP to input number and find pattern :1 12 123 1234 12345 123456




#include<stdio.h>

void main()

{

    int i,j,n;

    printf("Enter no. of pattern you want : ");

    scanf("%d",&n);

    for (i=1;i<=n;i++)

    {

        for (j=1;j<=i;j++)

        {

            printf("%d",j);

        }


    printf("\n");

    }


}

/* output



1

12

123

1234

12345

123456

 */

 

Post a Comment

0 Comments