It would also be easier to use a for loop in this instance, not a do...while, and you should really not use system() calls or namespaces.