> write C++ code to display all emrip numbers between 2 and 1000
That's not a question, that's a demand.
Do your own homework, or at least try to and show us what you can do by yourself.
Doing so tells us many things:
1. You're not a slacker looking to freeload off everyone else.
2. What the limit of your knowledge actually is.
3. How best to write a reply which might be the most benefit to you.