3 喜歡 0 不喜歡
64 瀏覽
Write a program that reads an integer and displays its multiplication table. For exam­ple, if the user enters 5, the output should be 1*5 = 5, 2*5 = 10,..., 10*5 = 50. The program should force the user to enter an integer within [1, 10], else return Invalid number.

Sample Input 1:

5

Sample Output 1:

1*5=5

2*5=10

3*5=15

4*5=20

5*5=25

6*5=30

7*5=35

8*5=40

9*5=45

10*5=50

Sample Input 2:

11

Sample Output 2:

Invalid number

 

References: C From Theory
[正常] Coding (C) - 最新提問 分類:Introduction to Computer Programming I (C) | 用戶: (20.9k 分)
ID: 21859 - 從幾時開始: 無限制 - 到幾時結束: 無限制
| 64 瀏覽
Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:172.69.7.53
©2016-2024

相關問題

3 喜歡 0 不喜歡
0 回答
[正常] 開放式問答 - 最新提問 2月 12, 2017 分類:Introduction to Computer Programming I (C) | 用戶: The Contributor (20.9k 分)
ID: 21926 - 從幾時開始: 無限制 - 到幾時結束: 無限制
| 116 瀏覽
3 喜歡 0 不喜歡
0 回答
[正常] 開放式問答 - 最新提問 2月 12, 2017 分類:Introduction to Computer Programming I (C) | 用戶: The Contributor (20.9k 分)
ID: 21923 - 從幾時開始: 無限制 - 到幾時結束: 無限制
| 119 瀏覽
2 喜歡 0 不喜歡
0 回答
[正常] 開放式問答 - 最新提問 2月 8, 2017 分類:Introduction to Computer Programming I (C) | 用戶: The Contributor (20.9k 分)
ID: 21880 - 從幾時開始: 無限制 - 到幾時結束: 無限制
| 94 瀏覽
2 喜歡 0 不喜歡
0 回答
[正常] Coding (C) - 最新提問 2月 8, 2017 分類:Introduction to Computer Programming I (C) | 用戶: The Contributor (20.9k 分)
ID: 21878 - 從幾時開始: 無限制 - 到幾時結束: 無限制
| 118 瀏覽
3 喜歡 0 不喜歡
0 回答
[正常] Coding (C) - 最新提問 2月 8, 2017 分類:Introduction to Computer Programming I (C) | 用戶: The Contributor (20.9k 分)
ID: 21874 - 從幾時開始: 無限制 - 到幾時結束: 無限制
| 89 瀏覽
12,783 問題
183,443 回答
172,219 留言
4,824 用戶