Refuses the entry if the user enters a float and keeps asking the user to enter an integer until the user responds properly and enters an integer.
i make this program but i don't know how to make the right way if there is better way will be great
printf("Enter integer: ");
printf("Try again (Please enter an integer)\n");
printf("The factorial of %d = %d\n",a,f);
It's because you used a variable with the type of integer:
Instead you should do
or if you want to have even better precision:
Besides that you need to change the expected type of variable in your input and output functions.
http://www.cplusplus.com/reference/cstdio/printf/ - if you look in the table at the top you can see that you used a symbol for signed integer type - %d. Similarly you should use %f for float and %lf for double.