hi guys
am a total noob with C++ and im trying to write a program that will take a user inputted integer and displays its divisors and then tell the user whether it is a perfect number or not.
So far I have
#include <iostream>
using namespace std;
int main() {
int n;
bool devisor;
cout << "enter number";
cin >> n;
for (int i = 0 ; i < n/2 ; i++ ){
devisor = true;
if ( n % i = 0 ){
devisor = false;
}
}
if(devisor){
cout << i << "is a devisor" << end1;
}
return 0;
}
any extra help will be much appreciated