Program to print palindrome triangle pattern using numbers for n number of lines.[Pattern:8]| Using C language| C Program series 29|
👨💻Program to print palindrome triangle Pattern using numbers (◣) for n number of lines.[Pattern:8]
Code :
For n number of LINES:
/*
Program to print palindrome triangle pattern using numbers for n number of lines.[Pattern:8]
For Example:n=5
1
121
12321
1234321
123454321
*/
#include<stdio.h>
main()
{
printf("Program to print palindrome triangle (Pattern:8) using numbers for n number of lines.\n\n");
int i,j,n;
//Here,
//n for number
//i for row
//j for colomn
printf("Enter the number:");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
for(j=1;j<=i;j++)
{
printf("%d",j);
}
for(j=i-1;j>0;j--)
{
printf("%d",j);
}
printf("\n");
}
}
The output of Code:
Comments
Post a Comment