Develop
2003.04.23 09:46
[c] 팩토리얼.. - 재귀함수
Views 9671 Comment 0
#include<stdio.h>
int factorial(int num){
if(num==1){
return 1;
}else{
num*=factorial(num-1);
return num;
}
}
void main(){
int num,result;
printf("Enter a number : ");
scanf("%d",&num);
result=factorial(num);
printf("n%d's factorial is %d !!n", num, result);
}
-
[mysql] 쓰레드가 계속 쌓이기 시작하고 사라지지 않을때..
-
[linux] 콘솔/Xwindow 에서 PC스피커 소리 없애기
-
[c] 프로그래밍 ppt, 스킬업 (비트 수업자료)
-
[c++] p.118 확인학습 5번
-
[c++] p.58 연습문제 2번
-
[c++] p.47 연습문제 3번
-
[opengl] 컴퓨터 그래픽스 강의 자료(수업자료)
-
[c] 그래픽스 자료(OpenGL 라이브러리) 샘플 소스
-
[sql] 간단한 SQL 문법 정리
-
[c] 간단한 채팅(클라이언트/서버) 프로그램 소스
-
[c] 팩토리얼.. - 재귀함수
-
[c] 하노이탑 - 재귀함수