Ask coding questions

← Back to all posts
1
Clearing a screen in repl.it for the C language
Yuvikiit (0)

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 (325) [earned 5 cycles]
View Answer
Commentshotnewtop
1
SPQR (325)

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 :)

1
Yuvikiit (0)

@SPQR
Sankyu(Thanks)
For Helping Me Out