Here's an example program in C++ that fulfills the requirements:
______________________________________________________
#include <iostream>
#include <vector>
using namespace std;
int main() {
// Declare a vector to store integers
vector<int> array;
// Read elements into the vector from the keyboard
int num;
while (true) {
cout << "Enter a number (or 0 to exit): ";
cin >> num;
if (num == 0)
break;
array.push_back(num);
}
// Print elements divisible by 5
cout << "Elements divisible by 5:\\";
for (int i : array) {
if (i % 5 == 0)
cout << i << " ";
}
cout << endl;
// Print elements with exactly two digits
cout << "Elements with exactly two digits:\\";
for (int i : array) {
if (i >= 10 && i <= 99)
cout << i << " ";
}
cout << endl;
// Print elements ending in 7
cout << "Elements ending in 7:\\";
for (int i : array) {
if (i % 10 == 7)
cout << i << " ";
}
cout << endl;
return 0;
}
_______________________________________________________
This C++ program declares a vector to store integers and reads elements from the keyboard until the user enters 0. It then iterates through the vector to print the numbers that satisfy the given conditions: divisible by 5, having exactly two digits, and ending in 7.
~~~Harsha~~~