0
What is wrong with this factorial code in c language?
I was trying coding factorial problem in c using functions. I don't get this https://code.sololearn.com/cZRCs2gI7lxY/?ref=app
2 Answers
0
You didn't declare fact
declare some value to fact before multiplying it. here for factorial use fact=1;
int i=1;
int fact=1;
while (i<=num)
{
fact=fact*i;
i++;
}
return fact;
0
Thankyou
I made a silly mistake hehe