#include<stdio.h>
int factorial(int n)
{
int x=1;
while(n>0)
{
x*=n--;
}
return x;
}
int main(void)
{
int num;
printf("Input Number : ");
scanf("%d",&num);
printf("Factorial %d : %d",num,factorial(num));
}
'TEST > 자료구조와 함께 배우는 알고리즘 입문(C언어)' 카테고리의 다른 글
<5> Q3. 자료구조와 함께 배우는 알고리즘 입문 (C언어) (0) | 2021.01.08 |
---|---|
<5> Q2. 자료구조와 함께 배우는 알고리즘 입문 (C언어) (0) | 2021.01.08 |
<4> Q6. 자료구조와 함께 배우는 알고리즘 입문 (C언어) (0) | 2021.01.07 |
<4> Q4. Q5. 자료구조와 함께 배우는 알고리즘 입문 (C언어) (0) | 2021.01.07 |
<4> Q3. 자료구조와 함께 배우는 알고리즘 입문 (C언어) (0) | 2021.01.05 |