#include<stdio.h>
#include<conio.h>
int main()
{
int i,j,k,z,m;
char a;
printf("Enter of what do you wanna have the triangle\n");
scanf("%c",&a);
printf("\nHow many lines of triangle do you want?\n");
scanf("%d",&z);
m=z;
for(i=0;i<z;i++)
{
for(j=0;j<m-1;j++)
printf(" ");
for(k=0;k<i+1;k++)
printf("%c ",a);
printf("\n");
m--;
}
getch();
return 0;
}
No comments:
Post a Comment