Ashutosh_shukla

Hi OrAnGeWorX what I could make out of your question is that user enters N numbers and you want the perfect numbers. You also want the product of non perfect numbers.I have tried something I hope you will go through it and reply me.

The code is :

#include<iostream.h>
#include<conio.h>
#define MAXSIZE 100
void main()
{
int a[MAXSIZE],n,i,j,sum;
long int prod=1;
clrscr();
cout<<"Enter the number of elements to be checked : ";
cin>>n;
cout<<"Enter the elements : ";
for(i=0;i<n;i++)
cin>>a[i];
cout<<"The perfect nos are : \n";
for(i=0;i<n;i++)
{
sum=0;
for(j=1;j<a[i];j++)
if(a[i]%j==0)
sum+=j;
if(sum==a[i])
cout<<a[i]<<endl;
else
prod*=a[i];
}
cout<<"The product of non perfect numbers is : "<<prod;
getch();
}

Ashutosh_shukla, thanks for replying.. i should rephrase myself as far as the problem and coding this in C shouldn't be problematic (i guess)

The user enters N for number of integers he'd like to check if or not they are perfect.

stage 1: how many numbers do u want to check?

user enters up to 10 and hits enter

stage 2: program now waits for user to input his n numbers that will be saved in a table.

stage 3: program goes through table[0] to table[n-1] and calculates if integer in each position is perfect or not, display a message accordingly, table[n] = integer is / is not a perfect number and in that same loop calculate the product (multiplication) of the non perfect numbers

finally to display that last number.

Thanks in advance.

Marc

i'll try convertin this to C and see if that works.... having some problems with dev-c++, compiling is fine but when i execute, program is crashing with windows send report window..