154. C Program to Print Triangle using Name.
How does this program work?
- This Program is used to print the triangle using name.
Here is the code
#include <string.h>
int main(void)
{
char string[100];
int c, k, length;
printf("Enter a string\n");
gets(string);
length = strlen(string);
for ( c = length ; c >0 ; c--)
{
for( k = 0 ; k < c ; k++)
{
printf("%c", string[k]);
printf(" ");
}
printf("\n");
}
return 0;
}