factorial tag

2 questions


1 answers
136 views
0
I found something strange in the factory calculation, so I'm asking you a question!

1.#include <stdio.h>int main(void){ int a,i; scanf(%d,&a); for(i=1; i<a; i++) { a = a*i; } printf(%d,a); return 0;}2.#include <stdio.h>int main(void){ int a,i; scanf(%d,&a); fo...

2 years ago

1 answers
78 views
0
C언어 팩토리얼 재귀함수 구현 시 return 1의 의미가 뭔가요?

#define _CRT_SECURE_NO_WARNIGS#include<stdio.h>#include<stdlib.h>int factorial(int n);int main() { int n; scanf(%d, &n); printf(%d\n, factorial(n)); return 0;}int factorial(int n) { if...


© 2024 OneMinuteCode. All rights reserved.