Follow This Blog For more... 😊

Program to print right side triangle Pattern (◢) using numbers for n number of lines.[Pattern 11]| Using C language| C Program series 32|

👨‍💻C Program to print Right side triangle Pattern () using numbers for n number of lines.[Pattern:11]

Code :

For n number of LINES:


    /*
    Program to print right side triangle Pattern using numbers for n number of lines.[Pattern 11]
    For Example n=5
   
        1
       21
      321
     4321
    54321
   
    */
    #include<stdio.h>
    main()
    {
        printf("Program to print right side triangle Pattern using numbers for n number of lines.[Pattern 11]\n\n");
       
        int i,j,n,space;
        //Here,
        //space is an integer variable
        //n for the number
        //i for row
        //j for column
       
        printf("Enter the number:");
        scanf("%d",&n);
       
        for(i=1;i<=n;i++)
        {
            for(space=1;space<(n-i+1);space++)
            {
                printf(" ");
            }
            for(j=i;j>0;j--)
            {
                  printf("%d",j);
            }
            printf("\n");
        }
    }

The output of Code:





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

Comments

Popular Posts