Code: Select all
#include <iostream>
#include<cmath>
using namespace std;
int main()
{
int n;
int l;
float x;
int y;
int k;
int P;
l=1;
n=1;
cout<<"Please enter an upper bound"<<endl;
cin>>k;
while(n<=k)
{
x=n/(floor(sqrt(n))-l);
y=n/(floor(sqrt(n))-l);
while(x!=y)
{
l--;
}
cout<<abs(n/y-y)<<endl;
n++;
}
cout<<"Finished! Thank you. Press any key to exit."<<endl;
cin>>P;
if(P=0)
{
return 0;
}
return 0;
}