+ 1

I m unable to use clrscr ( )..in this code. It's showing garbage value when I enter the value of cp nd sp.

https://code.sololearn.com/ce7cFzEE9A3K/?ref=app

2nd Feb 2018, 5:15 PM
Deepak Bhalode
Deepak Bhalode - avatar
7 Réponses
+ 2
clrscr() is a part of conio.h which is a non-standard and deprecated header.
2nd Feb 2018, 5:54 PM
Vlad Serbu
Vlad Serbu - avatar
+ 2
You can't clear the screen in Sololearn. For *nix systems: printf("\033[2J"); For Windows: I can't think of a time that'd be useful since you're generally not doing command-line programs. If you must use system("cls") or for(i=0; i < 100; ++i) printf("\n"); Note: C doesn't understand the concept of a screen, all it knows is data streams (FILEs, stdin, stdout and stderr), which is why there's no standard way of doing it.
2nd Feb 2018, 6:08 PM
Vlad Serbu
Vlad Serbu - avatar
+ 2
I think Sololearn's Code Playground is based on Windows, so the conio.h header might exist and not work properly.
2nd Feb 2018, 6:14 PM
Vlad Serbu
Vlad Serbu - avatar
+ 1
Wat should I do nw..should I include dt header file.? or is there any other way?
2nd Feb 2018, 5:58 PM
Deepak Bhalode
Deepak Bhalode - avatar
+ 1
then sir y it's showing garbage value that is the actual prblm ?...nd I want to sort out dt...it's output is true it's just nt showing the entered value of cp nd sp.
2nd Feb 2018, 6:11 PM
Deepak Bhalode
Deepak Bhalode - avatar
+ 1
ok...I will try another type of problem .....bt thnx fr ur help sir.
2nd Feb 2018, 6:16 PM
Deepak Bhalode
Deepak Bhalode - avatar