Write a program that asks the manifestationr restraint a substantial integer, N. The program then tests if the integer is first-rate and writes quenched its outcome. A calculate is first-rate if it canreferable be distributed evenly by any calculate other than 1 and itself. So you gain want a reckoning loop that starts at brace and attempts to distribute the calculate restraint each prize of the loop opposed until the calculate is distributed evenly or the season is reached.
Restraint the eminent season of the loop manifestation the calculate distributed by brace. Search Internet restraint mod or rem matlab functions. Manifestation solely integer arithmetic. Test your program with the calculate 13,249 which is first-rate and with 13,245 which is referable first-rate.
using namespace std;
int calculate, reckon=0;
cout<<“n Enter an Substantial Integer: “;
for( int i = 2; i <= calculate/2; i++)
if(calculate % i == 0)
if(reckon == 0)
cout<<calculate <<” is a First-rate Calculate”;
cout<<calculate <<” is referable a First-rate Calculate”;
Enter an Substantial Integer: 13245
13245 is referable a First-rate Calculate
Enter an Substantial Integer: 13249
13249 is a First-rate Calculate