-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmultiplication_table.c
67 lines (51 loc) · 1.13 KB
/
multiplication_table.c
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
#include <stdio.h>
#include <stdlib.h>
// Prototypes
void Design();
void Multiplication();
int main()
{
Design();
Multiplication();
return 0;
}
// For design
void Design()
{
int i;
for(i = 0; i<50; i++)
{
printf("=");
}
printf("\n");
printf("\t\tMultiplication Table\n\n");
for(i = 0; i<50; i++)
{
printf("=");
}
printf("\n\n");
}
// For the muliplication table
void Multiplication()
{
int table, multiples, maxMlt;
int continuance = 1;
while(continuance == 1)
{
printf("Insert table: ");
scanf("%d", &table);
printf("\nInsert max multiple: ");
scanf("%d", &maxMlt);
printf("\nTABLE OF %d\n", table);
for (multiples=0; multiples<=maxMlt; multiples++)
{
printf("%d x %d = %d\n", table, multiples, table*multiples);
}
printf("\nProceed with another table?\n");
printf("-press 1 to proceed\n");
printf("-press ANY OTHER NUMBER to end program\n");
scanf("%d", &continuance);
printf("\n");
system("clear"); // Clears the console screen
}
}