clrscr()
just add the following to your code to clear the screen first before executing your program.
gotoxy()#include<stdlib.h>
main()
{
system("clear"); //clears the screen
}
just add the following to your code to use the gotoxy() function, which changes the position of the cursor to the desired coordinates of your screen.
#include<stdio.h>
//gotoxy function
void gotoxy(int x,int y)
{
printf("%c[%d;%df",0x1B,y,x);
}
main ()
{
gotoxy(25,50); //reposition cursor
printf("hello world"); //display text
}
Bookmarks