// This C program named times_tb.c is to prepare and display "times table" // Author ... (type here your name) // Date ... (type here the current date) // For ... (institution, course, purpose) //--------------------------------------------------------------------------- #include //Handles the keyboard input and screen output #include //Handles DOS system commands ("cls", "pause", etc.) int times, by, answer; //Declaration of working global variables int times_min, times_max; //Declaration of table border values void main() { system ("cls"); //This clears screen printf("\nThis program prepares TIMES TABLE\n"); printf ("\nEnter low value of times table range (e.g. 7): "); scanf ("%ld", ×_min); printf ("Enter top value of times table range (e.g. 8): "); scanf ("%ld", ×_max); printf ("\n"); for ( times = times_min; times <= times_max; times++) { printf("\n%2d times table.\n", times); for (by = 1; by <= 10; by++) { answer = times * by; printf ("%2d x %2d = %3d\n", times, by, answer); } } system("pause"); // DOS "Pause" (for user to look at results) }