No, that is still poorly formatted and incomplete. This is what I had in mind:
Code:
#include <stdio.h>
int facto(int x);
int main(void)
{
int a, fact;
printf("Enter an integer");
scanf("%d", &a);
fact = facto(a);
printf("The Factorial of the integer is%d", fact);
}
int facto(int x)
{
int i = 1;
for (i = 1; i <= x - 1; i++)
{
x = x * i;
}
return(x);
}
Notice the header that is included and the declaration of facto before it is used in main. Notice that main now has its return type explicitly stated. Since you omitted to explicitly return a value from main, I have done the same since it just means "return 0;" at the end of main in the 1999 edition of the C standard and later.
Now, onto your problem: as Matticus suggested, you need to observe what is going on in the loop in facto. Use a debugger, print the variables, whatever. You need to see what is happening to understand what is going wrong and hence fix it.