Some initial observations.
1. main must be specified as returning an int.
Implicit return types became obsolete in 1989 with the first C standard.
2. Never EVER use gets()
gets, gets_s - cppreference.com
There is no way to make it safe, and it's been removed from the language completely.
3. What are x and y?
It's much easier to figure out what to do if you have meaningful variable names.
Code:
#include<stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
int main()
{
printf("Type a word: ");
char name[10];
fgets(name,sizeof(name),stdin);
// fgets will append a \n if there is room in the buffer
// this code will remove it, if it's present.
{
char *p;
if ((p = strchr(name, '\n')) != NULL)
*p = '\0';
}
// strlen returns a size_t
size_t len = strlen(name);
for ( size_t row = 1 ; row <= len ; row++ ) {
size_t indent = 10;
for ( size_t spaces = 0 ; spaces < indent ; spaces++ ) {
printf(" ");
}
for ( size_t words_on_row = 1 ; words_on_row <= row ; words_on_row++ ) {
printf(" %s", name);
}
printf("\n");
}
return 0;
}
Now look at your pattern
--------------------Test
---------------Test Test
----------Test Test Test
-----Test Test Test Test
Test Test Test Test Test
Count the spaces, and discover that the sequence is 20, 15, 10, 5, 0.
What you do now is come up with some kind of mathematical expression involving the variables you have, that would generate that sequence of numbers.