Can somebody help me with the following logic-- how to do it

I need to print a page once every 25 transactions but -- which transaction it prints for should be random.

I mean it might print for 1 st transaction in the first 25 transactions and print for 35th transaction in the next 25 transactions(25-50)-- basically this should be random making sure that it is printing only once every 25 transactions starting from 1.

2. Something like this ?
Code:
```struct transaction {
....
};

int main() {
#define MAXTRANS 1000;
transaction transactions[MAXTRANS];
srand(time(0));
for ( int i = 0; i < MAXTRANS / 25; ++i ) {
int rnd = rand() % 25;
printit( transactions[i*25 +rnd] );
}
}```
Kurt

3. Thanks a lot for the prompt reply but I do not have MAXTRANS..maximum number of transactions and I have to print not the transaction but a same page for every random transaction selected

4. Have a loop that just keeps repeating as long as you have transactions. In the loop:

- Pick a random number between 1 and 25
- Keep count of the number of transactions. If this number matches your random number, print a report.
- Increment your count of the transactions. If it's now over 25, set it equal to 1 again.