C Program to print Pyramid Pattern using two symbols (like '*' and 'A') for n number of lines.[Pattern 15]| Using C language| C Program series 36|
👨💻C Program to print Pyramid Pattern (▲) using two symbols (like '*' and 'A') for n number of lines.[Pattern:15]
Code :
For n number of LINES:
/*
C Program to print Pyramid Pattern using two symbols (like '*' and 'A') for n number of lines.[Pattern 15]
For Example:n=5
*
*A*
*A*A*
*A*A*A*
*A*A*A*A*
*/
#include <stdio.h>
main()
{
int i,j,k,n,temp;
printf("C Program to print Pyramid Pattern using two symbols (like '*' and 'A') for n number of lines.[Pattern 15]\n\n");
printf("Enter the number:");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
temp=n;
for(j=temp-i;j>0;j--)
{
printf(" ");
}
for(j=1;j<=i;j++)
{
printf("*");
if(j<i)
{
printf("A");
}
}
printf("\n");
}
}
The output of Code:
Comments
Post a Comment