재귀함수로

1+1/2+1/3..+1/n

구하는건데요

#include <stdio.h>

float div(float n);

int main()
{
        int x;
        
        printf("수 입력 :");
        scanf("%d", &x);

        printf("%lf", div(x));

        return 0;


}

float div(float n)
{
        if(n==1)
                return 1;
        else
        {
                return (1/n)+div(n-1);
        }
}

이렇게 짰어요 근데 float div(float n)으로 하기전에 float div(int n)으로 할때는 무조건 1만나오는데 왜 그렇게 나오는지 모르곘어요

int 형으로 받고 받은값을 float 형으로 출력하고 싶었는데 왜 1만나오는지 설명좀 해주시면 감사하겠습니다!!