a program that prints all the numbers from 1 to 1000 that are divisible by 7. (in C++)

To write a program in C++ that prints all the numbers from 1 to 1000 divisible by 7, you can use a loop and a conditional statement. Here's an example program:

```c++
#include <iostream>

int main() {
for (int i = 1; i <= 1000; i++) {
if (i % 7 == 0) {
std::cout << i << " ";
}
}

return 0;
}
```

Let's break down the code step by step:

1. We include the `<iostream>` library to use the `std::cout` and `std::endl` statements for printing.
2. In the `main()` function, we define a loop using a `for` loop. The loop variable `i` is initialized to 1, and the loop continues as long as `i` is less than or equal to 1000.
3. Inside the loop, we use an `if` statement to check if `i` is divisible by 7. The remainder of `i` divided by 7 (`i % 7`) is equal to 0 in that case.
4. If `i` is divisible by 7, we print it using `std::cout`.
5. Finally, we `return 0` to indicate successful program execution.

When you run this program, it will print all the numbers from 1 to 1000 that are divisible by 7. You can further modify the program if you want to print the numbers in a different format or range.