Help me find the error in this program

//to find factors of a number
#include<stdio.h>
int factor(int n)
{
while(n>0)
{
for(int i=2;i<n;i++)
{
if(n%i==0)
{
printf("%d “,i);
n=n/i;
break;
}
}
}
}
void main()
{
int n;
printf(“enter number”);
scanf(”%d",&n);
factor(n);
}

dont update n and remove break and also remove while loop