78 Programming and Data Structures
getcheO;
I
QU3EJI;
Enter Text Here: How are you?
Your Entered Text: How are you?
Explanation In this example character pointer ' t ' is declared. The cge t s () function reads string
through the keyboard and the cputs () function displays the string on the console.
4.4 COMMONLY USED LIBRARY FUNCTIONS
1 c l r s c r () This function is used to clear the screen. It dears the previous output from the screen and
displays the output of the current program from the first line of the screen. It is defined in conio.h
header file. The syntax is as follows.
Syntax
clrs c r ();
2 e x it () This function terminates the program. It is defined in p rocess. h header file. The syntax is
as follows.
Syntax
e x it ( ) ;
3 sleep () This function pauses the execution of the program for a given number of seconds. The
number of seconds is to be enclosed between the parenthesis. It is defined in d o s. h header file. The
syntax is as follows.
Syntax
sleep (1) ;
4 sys tem () This function is helpful in executing the different dos Commands. It returns 0 on success
and -1 on failure. The syntax is as follows.
Syntax
system ("d ir");
The command should be enclosed within the double quotation marks.
SUMM ARY
This chapter deals with formatted functions such as p r in tf () and sca n f () statements. The
unformatted functions such as pu tchar ( ) , g e tch e ( ) , g e ts () etc. have been illustrated with
suitable examples. The different data types and conversion symbols used in the C programs have also
been elaborated. The special symbols such as escape sequences together with their applications are
also discussed. Few of the functions which are commonly used in the programs such as c lr s c r (),
e x i t 0 etc. are described in this chapter.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.133.126.199