std::cout << "Enter the elements of the array w(1:7): "; for (int i = 0; i < 7; i++) { std::cin >> w[i]; } std::cout << "Enter the value of t: "; std::cin >> t; for (int i = 0; i < 7; i++) { if (w[i] < t) { count++; } } std::cout << "Number of elements in the array w(1:7) that are less than " << t << ": " << count << std::endl; return 0;
int main() {
std::cout << "Enter the elements of the array w(1:7): ";int w[7];
int t;
int count = 0;
for (int i = 0; i < 7; i++) {
std::cin >> w[i];
}
std::cout << "Enter the value of t: ";
std::cin >> t;
for (int i = 0; i < 7; i++) {
if (w[i] < t) {
count++;
}
}
std::cout << "Number of elements in the array w(1:7) that are less than " << t << ": " << count << std::endl;
return 0;
}