#include <iostream>
#include <string>
#include <fstream>
usingnamespace std;
int main()
{
int i = 100;
int x=0;
while (x<=999)
{
if (x==i)
{
cout << x << " is equal to " << i << endl;
break;
}
else
{
cout << x << " is not equal to " << i << endl;
x++;
}
}
return(0);
}
To make it run faster, comment out the "is not equal to" line.
#include <iostream>
#include <string>
#include <fstream>
usingnamespace std;
int main()
{
int i = 100;
int x = 99;
if (x!=i)
{
cout << x << " is not equal to " << i << endl;
}
else
{
cout << x << " is equal to " << i << endl;
}
return(0);
}