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 = 1; i <= a; i++)
{
// column
for (int j = 1; j <= i; j++)
{
printf("* ");
}
printf("\n");
}
}
OUTPUT
enter a value of a: 7
*
* *
* * *
* * * *
* * * * *
* * * * * *
* * * * * * *
0 Comments