anishvk profile image82

when i started to learn c language i did not use the keywords like "clrscr" and "getch". Without it the programe did not run why?

asked by anishvk 7 months ago

flag

rajkishor09 profile image

rajkishor09 says

Clrscr (Clear screen) function is used for clear the output console and we generally place it after variable declaration. If you don’t use clear screen then the result of previous program run and current program run will mix together and beginner will have difficult to get the output of program. Getch (get character) function is used for accepting character input from keyboard but it does not show character on the output console. So, we use it at the end of program, before closing of main function brace, so that it will wait for a keyboard input and we can see the result of program we executed. If you use turbo C compiler then you can press Alt + F5 and it will show you the output screen.

 |  (+1)
nicomp profile image 59

Answered HubPage Question: when I started to learn c language i did not use the keywords like

clrscr() is not part of standard C or C++. It was part of the original Borland C compiler as long as the header conio.h was included in the program. For example:#include // Include the conio.h file in the... keep reading →

 |  (+1)
 |  1 comment
priyankmaniar profile image 75

Explaining :- clrscr (); and getch(); in C

clrscr(); and getch(); requires the header file conio.h i.e #include clrscr();  :- This is use to clear the output screen i.e console suppose you run a program and then alter it and run it again you may... keep reading →

 |  (0 votes)
 |  4 comments

You can vote each answer up or down to show your support or disapproval. You cannot flag an answer, but if an answer receives enough down votes compared to up votes, then it will become hidden.

Ask A Question

working