Thanks for trying help, but I think I need to study more about recursion and returning, I've fixed my program using a pointer and an auxiliary variable. See below:
Code:
#include<stdio.h>
#include<stdlib.h>
void encaixa(int x, int y, int *p);
int main()
{
int a, b, ma, me, aux = 0, *p;
p = &aux;
do
{
printf("Entre com um inteiro positivo: \n");
scanf("%d", &a);
if(a < 0)
printf("O número deve ser positivo\n");
}while(a < 0);
do
{
printf("Entre com outro inteiro positivo: \n");
scanf("%d", &b);
if(b < 0)
printf("O número deve ser positivo\n");
}while(b < 0);
if(a >= b){
ma = a;
me = b;
}
else{
ma = b;
me = a;
}
encaixa(ma, me, p);
printf("%d\n", aux);
return 0;
}
void encaixa(int x, int y, int *sig)
{
if(x == y)
*sig = 1;
else if(x % 10 == y % 10)
encaixa(x / 10, y / 10, sig);
else if(y == 0)
*sig = 1;
else
*sig = 0;
}