Follow This Blog For more... 😊

Program to print triangle using numbers (◣) Pattern:4 for n number of lines.| Using C language| C Program series 25|

👨‍💻Program to print triangle using numbers () Pattern:4 for n number of lines.

Code :

For n number of LINES:

    /*
    Program to triangle using numbers Pattern:4 for n number of lines.
    For Example n=8
    1
    12
    123
    1234
    12345
    123456
    1234567
    12345678
    */
    #include<stdio.h>
    main()
    {
        printf("Program to triangle using numbers Pattern:4 for n number of lines.\n\n");
       
        int i,j,n;
        //n for number
        //i for row
        //j for colomn
       
        printf("Enter the number:");
        scanf("%d",&n);
       
        for(i=1;i<=n;i++)
        {
            for(j=1;j<=i;j++)
            {
                printf("%d",j);
            }
            printf("\n");
        }
    }

The output of Code:






👉Click for more C Program series Questions.[Questions list]

Comments

Popular Posts