Write the reason you're deleting this FAQ
Today I have just write a simple program to find factorial of a number. I have done this for college. I have wrote and run the code with CodeBlocks But when I was trying to run the code with trubo it was giving wrong result for large number !! I don't know why ?? anybody can help me with this please ??
My code...
#include <stdio.h>
int main ()
{
int number,i,factorial;
factorial = 1;
printf("Please enter an integer : ");
scanf("%d", &number);
if (number < 0)
{
printf("Factorial of negative value does not exist !!");
}
else
{
for (i = 1; i <= number; i++)
{
factorial = factorial * i;
}
printf("Factorial of %d is %d", number,factorial);
}
return 0;
}