Computer Science, asked by babusony8473, 9 months ago

If the resultant of adding the encrypted number and number entered by a terrorist is a perfect number, then print "They can read the message". Otherwise, print "They can't read the message".

Answers

Answered by Yamini1999
2

Answer:

#include<iostream>

using namespace std;

int main()

{

int a,b,c,n,sum=0;

cin>>a;

cin>>b;

n=a+b;

for(int i=1;i<n;i++)

{

c=n%i;

if(c==0)

{

sum=sum+i;

}

}

if(sum==n)

{

cout<<"They can read the message";

}

else

{

cout<<"They can't read the message";

}

return 0;

}

Similar questions