Avoid using system(). Since you are using Windows, use the Console API do clear the screen:
Code:
#include <windows.h>
...
void clearscreen(void)
{
  HANDLE hConsole;
  COORD coord = {0, 0};
  CONSOLE_SCREEN_BUFFER_INFO csbi;
  DWORD dwConsoleSize, dwWriten;
  
  hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
  GetConsoleScreenBufferInfo(hConsole, &csbi);
  dwConsoleSize = csbi.dwSize.X * csbi.dwSize.Y;
  
  FillConsoleOutputCharacter(hConsole, (TCHAR)' ', 
                             dwConsoleSize, coord, &dwWriten);
  FillConsoleOutputAttribute(hConsole, csbi.wAttributes, 
                             dwConsoleSize, coord, &dwWriten);
 
  SetConsoleCursorPosition(hConsole, coord);
}
And, on Windows you can use Sleep() to wait N milisseconds.