int main() { int N; cout << "Enter the size of the array: "; cin >> N;
int A[N]; cout << "Enter the elements of the array:\n"; for (int i = 0; i < N; i++) { cin >> A[i]; } int min = A[0]; int count = 1; for (int i = 1; i < N; i++) { if (A[i] < min) { min = A[i]; count = 1; } else if (A[i] == min) { count++; } } cout << "The minimum value in the array is " << min << " and it appears " << count << " times." << endl; return 0;
using namespace std;
int main() {
int A[N];int N;
cout << "Enter the size of the array: ";
cin >> N;
cout << "Enter the elements of the array:\n";
for (int i = 0; i < N; i++) {
cin >> A[i];
}
int min = A[0];
int count = 1;
for (int i = 1; i < N; i++) {
if (A[i] < min) {
min = A[i];
count = 1;
} else if (A[i] == min) {
count++;
}
}
cout << "The minimum value in the array is " << min << " and it appears " << count << " times." << endl;
return 0;
}