You already know how to do this. See your original post under "cout <<"\n\nThe matrix entered is as follows:\n";"