Write a program in C to display the pattern like a right angle triangle with a number.



QUESTION:-  Write a program in C to display the pattern like a right angle triangle with a number. 

The pattern like : 

1 

22 

333 

4444 


program

#include <stdio.h>

#include <conio.h>

void main()

{

    int a;

    printf("enter a value of a: ");

    scanf("%d", &a);

    // row

    for (int i = 1i <= ai++) // 1 1 1 1 1

    {

        // column

        for (int j = 1j <= ij++)

        {

            printf("%d"i); // 1 2 3 4 5
        }

        printf("\n");
    }
}


OUTPUT
enter a value of a: 5
1
22
333
4444
55555

Follow our page for regular updates.

0 Comments