Skip to content
Sign upLog in
← Back to Community

Clearing a screen in repl.it for the C language

Profile icon
Yuvikiit

Hello everyone,
Actually I needed to clear the screen for my C code when re-executed.
I included the stdlib.h header and used system("cls") as it works in codeblock but seems that same doesn't work with Repl.
So please let me know how to do the same process here.
Happy Coding to All :)

Answered by SPQR [earned 5 cycles]
View Answer
Voters
Profile icon
AxlRose2
Profile icon
HubertBrymerski
Profile icon
34-naangsaawra1
Profile icon
sumamanranprai
Profile icon
DFEK
Profile icon
Yuvikiit
Comments
hotnewtop
Profile icon
SPQR

You can print "\033[0;0H\033[2J" to the console to clear it. This is an ANSI escape code. The \033[ tells the console that an escape sequence comes next. 0;0H resets the cursor position and 2J actually clears the screen.

Please mark this as the answer if I solved your problem :)

Profile icon
Yuvikiit

@SPQR

Sankyu(Thanks)
For Helping Me Out

Profile icon
Petero2005

U can use system("clear")