the last program I will ask about is this: #include <iostream> using namespace s
ID: 3616018 • Letter: T
Question
the last program I will ask about is this:#include <iostream>
using namespace std;
int main() {
int num [10];
int i, u;
for (u = 0; u < 10; u++) {
cout << "Enter number: ";
cin >> num [u]; }
for (u = 0; u < 10; u++) {
for (i = 9; i >= 0; i--) {
for ( ;u != i; ){
if (num[u] = num[i]) cout << num [u] << " is duplicated. ";
else cout <<"No duplicated values found. "; }
}
}
return 0;}
the program is designed to find duplicated values for 10 valuesentered, I don't understand why it didn't work as it should. Canyou tell me why?