Hi,

Pleas help me to solve this ............I tried...but now ...I am feeling really tired.,my brain is standstill.....

HELPPPPPP!

The question is to find perfect number between 1 to 100.Well,who doesnt know perfect no.is the sum of its factors ,including 1 but not number itself.For eg .6 =1+2+3 is perfect no.

The problem is of finding perfect number from 1 to 100.

I have almost completed it (I assume....

But I am stucked on the last part.

I am checking the totalof factors with original number ..to see its perfect number...

But its not showing the return value....???

Another probelm is of scrolling of the screen fast.

I just dont know the syntax of pausing it..and where in my prog should I use it????

thanks in advance.......Help!!

My code :

//function perfect//

#include<iostream>

using std::cin;

using std::cout;

using std::endl;

using std::ios;

int perfect();//funcn prtotype

int main()

{

perfect();//calling funcn

return 0;

}

int perfect ()//funcn defn

{

int quo,rem,result,counter,count;

quo=0;

rem=0;

result=0;

for(count=1;count<=100;count++)//nos from 1 to 100

{

for(counter=1;counter<count-1;counter++) //nos for dividing it with count

{

quo=count/counter;

rem=count%counter;

if (rem==0)//checking for remainder is 0 ans showing the factors

{

cout<<count<<"its factors:"<<counter<<endl;

result=result+counter;//storing the total of factors in result

}

}

cout<<"total of factors"<<result;

cout<<endl;

result=0;

}

if(count==result) //problem lies here.......??//

{

return count;

}

}

thanks in advance...