what is the error in the following fectorial find c program? : my logic is entered num store into temp variable and find factorial using temp = temp * (num-i) in side while until num is grater than 0 and initially i =1 , but I get problem that my loop goes in to infinite loop how to solve this problem ?

 
        #include <stdio.h>
        int main()
        {
	    int num,temp,i;
	    printf("Enter a Num who's factorial is need to be find : ");
	    scanf("%d",&num);
	    printf("num = %d\n",num);
	    temp = num;
	    printf("temp =  %d\n",temp);
	    i=1;
	    while(num > 0)
	    {
		temp = temp * (num-i);
		i++;
		printf(" i = %d\n ",i);
	    }
	    printf("fact = %d \n ",temp);
            return 0;
        }