void printPerfectNumbers(int n) {for (int i = 2; i < n; i++) {int sum = 1;for (int j = 2; j <= i/2; j++) {if (i % j == 0) {sum += j;}}
}
int main() {int N;std::cout << "Enter the value of N: ";std::cin >> N;
void printPerfectNumbers(int n) {
if (sum == i) {for (int i = 2; i < n; i++) {
int sum = 1;
for (int j = 2; j <= i/2; j++) {
if (i % j == 0) {
sum += j;
}
}
std::cout << i << " ";
}
}
}
int main() {
std::cout << "Perfect numbers less than " << N << " are: ";int N;
std::cout << "Enter the value of N: ";
std::cin >> N;
printPerfectNumbers(N);
return 0;
}