Star Pattern program | pattern 2 : Triangle pattern program in C
Write a C program to print Triangle star pattern.
Q: Write a C Program to print below Triangle star pattern.
*
* *
* * *
* * * *
* * * * *
Program: Triangle Star Pattern :
-
#include<stdio.h>
-
int main()
-
{
-
int i,j,n;
-
printf(“Enter How many rows you want: “);
-
scanf(“%d”,&n);
-
for(i=1;i<=n;i++)
-
{
-
for(j=1;j<=i;j++)
-
{
-
printf(“* “);
-
}
-
printf(“\n“);
-
}
-
return 0;
-
}
Output :
Output of star pattern |
Similar Programs:
Also See:
- Program to calculate Maximum of three numbers.
- What are Prime Number and C program to Check given number is Prime or Not
- Check given Number is Prime or not Using Square Root(sqrt) Function.(Efficient way)
- C Program to generate prime numbers between two numbers
- C Program to generate first N prime numbers.
- C program to Calculate percentage of student.
- C Program to check given year is the leap or not.
- C Program to convert Temperature.
- C program to understand type conversation.
- Finding Largest of two numbers using the conditional operator in C.
- C program to calculate the simple Interest,
- C program to understand Size of Operator.
- 200+ C Programs.
1 Response
[…] Pattern 2: Triangle Pattern Program […]