i'm working on a program to receive a word of 6 letters max. then organise it like this.
exemple: (ps.: just used - to organise the words the way i want)
--------------------Test
---------------Test Test
----------Test Test Test
-----Test Test Test Test
Test Test Test Test Test
all that i've got atm is the reverse of this, could som1 help me with this code?
thanks!!
Code:
#include<stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
main()
{
int x, y, size;
char name[6];
printf("Type a word: ");
gets(name);
size = strlen(name);
for (x = 1; x <= size; x++)
{
for (y = 1; y <= x; y++)
printf("%s\t", name);
printf("\n");
}
return 0;
}