Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # include <stdio.h>
- int fat(n) {
- int resultado = 1, f = n;
- while (f > 1) {
- resultado *= f;
- f -= 1;
- }
- return resultado;
- }
- int main(void) {
- int n = 0;
- printf("n: ");
- scanf("%d", &n);
- printf("%d\n", fat(n));
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement