This is not so much as a bug than as being inefficient. Change this to:

Code:
	system("CLS");
	
	int ch;

    while (ch!=10)
    {
    	system("CLS");
...
    }
Code:
     int ch;

     do {
    	system("CLS");
...
    } while (ch!=10)