Usually you want to clear the screen prior to writng to the terminal. Use; #include < conio.h> /* as in console I/O */ ... main() { ... clrscr(); Note that as this is a command, it must appear after your variable declarations.