How can I cheque if the result of a sum really should be an integer? ie"something" should be a way to check that the sum actually returns a natural integer, not just 'cos C++ forced it to be one.
int x =2;
int y;
int x =2;
int y;
for (x ; ; x++)
{
y = x / aim;
if (/*something*/)
{
cout<<"X: "<[Error: Irreparable invalid markup ('<x<<">') in entry. Owner must fix manually. Raw contents below.]
How can I cheque if the result of a sum really should be an integer? ie"something" should be a way to check that the sum actually returns a natural integer, not just 'cos C++ forced it to be one.
int x =2;
int y;
<pre>
for (x ; ; x++)
{
y = x / aim;
if (/*something*/)
{
cout<<"X: "<<x<<" Y: "<<y<<" Total: "<<x+y<<endl;
break;
}
}
</pre>
int x =2;
int y;
<pre>
for (x ; ; x++)
{
y = x / aim;
if (/*something*/)
{
cout<<"X: "<<x<<" Y: "<<y<<" Total: "<<x+y<<endl;
break;
}
}
</pre>
