i beleive that the problem is in the outer while loop, the condition
while(tolower(response=='y')) will always remain true.
coz response=='y' is a logical statement that would return 0 or 1 to the tolower function and that would always remain true may be it will work if you make it
while(tolower(response)=='y');
|