About your code:
1. what are the global variables supposed to be for? Get rid of them (by making them local).
2. your factorial function always returns 20. Even if it correctly calculated 20!, you'd still need at least a 64 bit integer (int64_t) to hold a number of that size.
3. You confused = with ==.
4. You don't exit the program when you find a number, so it takes ages to terminate.
5. The loop makes no sense. The only number that is evenly divisible by 20! is 20!.
6. There are numbers smaller than 20! that are divisible by 1...20.
7. main must return int.