I'm not sure what #include<conio.h> does but i dont think you need it. Converting a do while into just a while loop is very easy. Copy everything from the do section and place it into the while section. Then erase the do section. Once that is done move the request for numbers at the top of the while loop (so the following calculations can be made with input data). The last step would be moving the cout statements outside the while loop since you only want it displayed once and that too when all the numbers have been checked. Here is the solution since it was very easy but i suggest you practice converting while loops into do while loops and vice versa if you are having issues.