Write a program in C to display the pattern like a right-angle triangle using an asterisk(*)



QUESTION:-  Write a program in C to display the pattern like a right-angle triangle using an asterisk(*). 

The pattern like : 

* 

** 

*** 

**** 


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++)

    {

        // column

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

        {

            printf("* ");
        }

        printf("\n");
    }
}

OUTPUT
enter a value of a: 7
* *
* * *
* * * *
* * * * *
* * * * * *
* * * * * * *
Follow our page for regular updates.

0 Comments