Created
October 5, 2017 20:15
-
-
Save unaipme/bfa65f834d76e07e4100c5c769196128 to your computer and use it in GitHub Desktop.
Zenbaki oso bat emanda, bere faktoriala kalkulatu eta inprimatzen duen programa idatzi. Gogoratu 0-aren faktoriala 1 dela.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define _CRT_SECURE_NO_WARNINGS | |
#include <stdio.h> | |
int main(void) { | |
int n, emaitza; | |
char str[128]; | |
printf("Sartu zenbakia: "); | |
fgets(str, 128, stdin); | |
sscanf(str, "%d", &n); | |
emaitza = 1; | |
while (n > 1) { | |
emaitza *= n; | |
n--; | |
} | |
printf("Emaitza: %d\n", emaitza); | |
printf("Sakatu intro bukatzeko..."); | |
getchar(); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment