c – A program that displays on the screen all the vowels before each character of a chain

I need to write a program that asks for a string of characters and then, for each character of the string, that the program shows on the screen all the vowels before that character.

An example:
Write a string of characters: Hola_mundo
the vowels before the character H are:
the vowels before the character or are:
the vowels before the character l are: o
the vowels before the character a are: o
the vowels before the character _ are: o a
the vowels before the character m are: o a
the vowels before the character u are: o a
the vowels before the n character are: o a u
the vowels before the character d are: o a u
the vowels before the character or are: o to u

What I've done so far is this:

#include 
#include 
#include 
#define MAX 128

int main (int argc, char * argv[]) {

chain char[MAX];
int i = 0, j = 0, cont = 0;


printf ("Enter a string:");
scanf ("% s", string);

for (j = 0; j <strlen (string); j ++) {
    printf ("the vowels before the character% c are:", string[j]);
    for (i = 0; i <strlen (string); i ++) {
        if ((string[i] == 'a' || chain[i] == 'e' || chain[i] == 'i' || chain[i] == 'o' || chain[i] == 'u')) {
        printf ("% c", string[i]); // print the vowels.
        }
    }
    printf (" n");
}
return 0;
}

But this prints all the vowels in the chain, I tried inserting a loop but I can not get it to print only the vowels before each character of the string.
Let's see if someone can tell me how to solve the problem, thank you.