# Thread: Pausing a loop

1. ## Pausing a loop

Very new to programming and I am trying to get a program to retrieve a file and number it if it has more than 24 lines of info it should stop until prompted by the user. I know it needs a loop but how do I retain the numbers i.e. 1-24 then 25-49.....

2. in case you don't know what '%' means, it is modulus, and it returns the remainder of the division of two numbers

so this means the remainder of linenum divided by 24 will be 0 every 24 lines
47 / 24 = 1.958; //has a remainder of .958 so it doesnt work
48 / 24 = 2; //has no remainder so it works, yay!

3. The remainder and the decimal part of the quotient aren't equivalent.
The remainder is an integer.

4. The remainder of 47 / 24 is 23

5. or .04

6. ## no

Its just 23. I dont know where you got .4 from. Could you explain?

7. Code:
```if(wherey()%24==0)
{
cout<<"Press a key..."; getch();
}
//continue execution.```
Include conio.h and iostream.h

Compiler : Turbo C++ v1.01.

Popular pages Recent additions