- if (toupper (cgetc()) != 'Q') {
- /* Print the result */
- for (I = 2; I < COUNT; ++I) {
- if (Sieve[I] == 0) {
- printf ("%4d\n", I);
- }
- if (kbhit() && toupper (cgetc()) == 'Q') {
- break;
- }
- }
+ if (ReadUpperKey () != 'Q') {
+ /* Print the result */
+ J = 0;
+ for (I = 2; I < COUNT; ++I) {
+ if (Sieve[I] == 0) {
+ printf ("%4d\n", I);
+ if (++J == 23) {
+ printf ("Q to quit, any other key continues\n");
+ if (ReadUpperKey () == 'Q') {
+ break;
+ }
+ J = 0;
+ }
+ }
+ if (kbhit() && ReadUpperKey () == 'Q') {
+ break;
+ }
+ }