$30
COP 3223 Program #3: Divisor table
Program: Divisor table (table.c)
Your friend is an elementary school teacher who has just started teaching her class about
multiplication and division. You have been asked to help write a program that will print out a
table that, for any integer divisor between 1 and 100, includes only and all numbers that are
divisible by that divisor.
Your program will prompt the user to enter an integer divisor between 1 and 100 inclusive. If
the user does not enter a valid divisor value, your program should prompt the user again, as
many times as necessary, until a valid value has been entered.
Given a valid divisor, your program will print out a ten by ten table containing all integer values
between 1 and 100 that can be divided by the divisor. For those integer values that are not
divisible by the divisor value, your program will print a place holder consisting of three periods
in a row.
You table should allow a maximum of three columns for each integer value (the maximum value
that could be printed is 100 which requires three columns). Your table should print two blank
spaces between each column of numbers (keeping in mind that each column can be up to three
digits in width). Your output must look like the sample output below.
Sample Program Run #1 (User Input in Bold and Italics)
Please enter a number between 1 and 100:
1
Below are all numbers between 1 and 100 that are divisible by 1
1 2 3 4 5 6 7 8 9 10
11 12 13 14 15 16 17 18 19 20
21 22 23 24 25 26 27 28 29 30
31 32 33 34 35 36 37 38 39 40
41 42 43 44 45 46 47 48 49 50
51 52 53 54 55 56 57 58 59 60
61 62 63 64 65 66 67 68 69 70
71 72 73 74 75 76 77 78 79 80
81 82 83 84 85 86 87 88 89 90
91 92 93 94 95 96 97 98 99 100
Sample Program Run #2 (User Input in Bold and Italics)
Please enter a number between 1 and 100:
3
Below are all numbers between 1 and 100 that are divisible by 3
... ... 3 ... ... 6 ... ... 9 ...
... 12 ... ... 15 ... ... 18 ... ...
21 ... ... 24 ... ... 27 ... ... 30
... ... 33 ... ... 36 ... ... 39 ...
... 42 ... ... 45 ... ... 48 ... ...
51 ... ... 54 ... ... 57 ... ... 60
... ... 63 ... ... 66 ... ... 69 ...
... 72 ... ... 75 ... ... 78 ... ...
81 ... ... 84 ... ... 87 ... ... 90
... ... 93 ... ... 96 ... ... 99 ...
Sample Program Run #3 (User Input in Bold and Italics)
Please enter a number between 1 and 100:
0
Please enter a number between 1 and 100:
238
Please enter a number between 1 and 100:
101
Please enter a number between 1 and 100:
48
Below are all numbers between 1 and 100 that are divisible by 48
... ... ... ... ... ... ... ... ... ...
... ... ... ... ... ... ... ... ... ...
... ... ... ... ... ... ... ... ... ...
... ... ... ... ... ... ... ... ... ...
... ... ... ... ... ... ... 48 ... ...
... ... ... ... ... ... ... ... ... ...
... ... ... ... ... ... ... ... ... ...
... ... ... ... ... ... ... ... ... ...
... ... ... ... ... ... ... ... ... ...
... ... ... ... ... 96 ... ... ... ...
Deliverables
Please submit a file titled table.c containing your solution to this problems via WebCourses by
Sunday, September 25, 2016 at 11:00 PM:
Program: table.c