3 like 0 dislike
182 views
Write a program that reads an integer in [0,20] and displays its factorial, else display Invalid number. Note: n!=1*2*3*....*n , 0!=1.

Sample Input 1:

5

Sample Output 1:

120

Sample Input 2:

21

Sample Output 2:

Invalid number

 

References: C From Theory
[Normal] Coding (C) - asked in Introduction to Computer Programming I (C) by (20.9k points)
ID: 21862 - Available when: Unlimited - Due to: Unlimited
| 182 views
Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:172.69.6.16
©2016-2024

Related questions

6 like 0 dislike
0 answers
[Normal] Coding (C) - asked Oct 16, 2017 in Introduction to Computer Programming I (C) by thopd (12.1k points)
ID: 27173 - Available when: Unlimited - Due to: Unlimited
| 354 views
6 like 0 dislike
0 answers
[Normal] Coding (C) - asked Oct 10, 2017 in Introduction to Computer Programming I (C) by thopd (12.1k points)
ID: 25999 - Available when: Unlimited - Due to: Unlimited
| 243 views
3 like 0 dislike
0 answers
[Normal] Coding (C) - asked Jan 25, 2017 in Introduction to Computer Programming I (C) by The Contributor (20.9k points)
ID: 21793 - Available when: Unlimited - Due to: Unlimited
| 215 views
12,783 questions
183,443 answers
172,219 comments
4,824 users