Write a program that asks the correctionr coercion a substantial integer, N. The program then tests if the integer is perfect and writes extinguished its product. A sum is perfect if it canreferable be separated evenly by any sum other than 1 and itself. So you allure demand a estimateing loop that starts at span and attempts to deal-out the sum coercion each estimate of the loop opposed until the sum is separated evenly or the proviso is reached.
Coercion the conspicuous proviso of the loop correction the sum separated by span. Search Internet coercion mod or rem matlab functions. Correction singly integer arithmetic. Test your program with the sum 13,249 which is perfect and with 13,245 which is referable perfect.
using namespace std;
int sum, estimate=0;
cout<<“n Enter an Substantial Integer: “;
for( int i = 2; i <= sum/2; i++)
if(sum % i == 0)
if(estimate == 0)
cout<<sum <<” is a Perfect Sum”;
cout<<sum <<” is referable a Perfect Sum”;
Enter an Substantial Integer: 13245
13245 is referable a Perfect Sum
Enter an Substantial Integer: 13249
13249 is a Perfect Sum