Thank you Salem. I made the change you suggested plus a couple more and now it works great thank you very much. Here is the working code.

Code:

#include <iostream>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <iomanip>
using namespace std;
void doBreak (int & side1, int & side2, int & side3);
bool attempts ();
void randomNumberGen (int & num1, int & num2);
void main()
{
int count = 1;
double tests = 1000000;
double probability;
double triangle = 0;
srand (time(0));
do
{
attempts();
triangle = triangle + attempts();
count++;
}while (count <= tests);
probability = ((triangle * 100) / tests);
cout << setprecision(5);
cout <<"The probability that the broken glass rod will form a triangle is"
<< probability <<"% \n";
}
bool attempts ()
{
int side1, side2, side3, triangle;
doBreak (side1, side2, side3);
if
((side1 + side2) > side3 &&
(side1 + side3) > side2 &&
(side2 + side3) > side1)
{
return true;
}
else
{
return false;
}
}
void doBreak (int & side1, int & side2, int & side3)
{
int num1, num2;
randomNumberGen (num1, num2);
side1 = num1;
side2 = (num2 - num1);
side3 = 1000 - num2;
}
void randomNumberGen (int & num1, int & num2)
{
do
{
num1 = rand() % 999 + 1;
num2 = rand() % 999 + 1;
} while (!(num1 < num2));
}