SlideShare a Scribd company logo
1 of 11
Header file
Sr.No. Header Files & Description
1 stdio.h
Input/Output functions
2 conio.h
Console Input/Output functions
3 stdlib.h
General utility functions
4 math.h
Mathematics functions
5 string.h
String functions
6 ctype.h
Character handling functions
Sr.No. Functions & Description
1 printf()
It is used to print the strings, integer,
character etc on the output screen.
2 scanf()
It reads the character, string, integer etc from
the keyboard.
3 getc()
It reads the character from the file.
4 putc()
It writes the character to the file.
5 fopen()
It opens the file and all file handling functions
are defined in stdio.h header file.
6 fclose()
It closes the opened file.
7 remove()
It deletes the file.
8 fflush()
It flushes the file.
stdlib.h:Standard Library. It has the information of memory allocation/freeing functions.
Function Description
malloc() This function is used to allocate space in memory during the execution of the program.
calloc() This function is also like malloc () function. But calloc () initializes the allocated memory to zero. But, malloc() doesn’t
realloc() This function modifies the allocated memory size by malloc () and calloc () functions to new size
free() This function frees the allocated memory by malloc (), calloc (), realloc () functions and returns the memory to the system.
abs()
This function returns the absolute value of an integer . The absolute value of a number is always positive. Only integer
values are supported in C.
div() This function performs division operation
abort() It terminates the C program
exit() This function terminates the program and does not return any value
system() This function is used to execute commands outside the C program.
atoi() Converts string to int
atol() Converts string to long
atof() Converts string to float
strtod() Converts string to double
strtol() Converts string to long
getenv() This function gets the current value of the environment variable
setenv() This function sets the value for environment variable
putenv() This function modifies the value for environment variable
perror() This function displays most recent error that happened during library function call.
rand() This function returns the random integer numbers
delay() This function Suspends the execution of the program for particular time
Conio.h
Functions Description
clrscr() This function is used to clear the
output screen.
getch() This function is used to get a single
character from keyboard without echo.
textcolor() This function is used to define text
color.
Color code should be between 0 to 15
(0x00 to 0x0F)
textbackground() This function is used to define
background color of the text.
Color code should be between 0 to 15
(0x00 to 0x0F)
Math.h function Description Example
sqrt(x) square root of x
sqrt(4.0) is 2.0
sqrt(10.0) is 3.162278
exp(x) exponential (ex)
exp(1.0) is 2.718282
exp(4.0) is 54.598150
log(x) natural logarithm of x
log(2.0) is 0.693147
log(4.0) is 1.386294
log10(x) logarithm of x (base 10)
log10(10.0) is 1.0
log10(100.0) is 2.0
fabs(x) absolute value of x
fabs(2.0) is 2.0
fabs(-2.0) is 2.0
ceil(x)
rounds x to smallest
less than x
ceil(9.2) is 10.0
ceil(-9.2) is -9.0
floor(x)
rounds x to largest
greater than x
floor(9.2) is 9.0
floor(-9.2) is -10.0
pow(x,y) x raised to power y (xy) pow(2,2) is 4.0
fmod(x)
remainder of x/y as
number
fmod(13.657, 2.333) is
sin(x) sine of x (x in radian) sin(0.0) is 0.0
cos(x) cosine of x (x in radian) cos(0.0) is 1.0
tan(x) tangent of x (x in radian) tan(0.0) is 0.0
String.h
String functions Description
strcat ( ) Concatenates str2 at the end of str1
strncat ( ) Appends a portion of string to another
strcpy ( ) Copies str2 into str1
strncpy ( ) Copies given number of characters of one string to another
strlen ( ) Gives the length of str1
strcmp ( )
Returns 0 if str1 is same as str2. Returns <0 if strl < str2. Returns >0 if str1 >
str2
strcmpi ( )
Same as strcmp() function. But, this function negotiates case. “A” and “a” are
treated as same.
strchr ( ) Returns pointer to first occurrence of char in str1
strrchr ( ) last occurrence of given character in a string is found
strstr ( ) Returns pointer to first occurrence of str2 in str1
strrstr ( ) Returns pointer to last occurrence of str2 in str1
strdup ( ) Duplicates the string
strlwr ( ) Converts string to lowercase
strupr ( ) Converts string to uppercase
strrev ( ) Reverses the given string
strset ( ) Sets all character in a string to given character
strnset ( ) It sets the portion of characters in a string to given character
strtok ( ) Tokenizing given string using delimiter
String functions Description
memset()
It is used to initialize a specified number of bytes to null or any other
value in the buffer
memcpy()
It is used to copy a specified number of bytes from one memory to
another
memmove()
It is used to copy a specified number of bytes from one memory to
another or to overlap on same memory.
memcmp() It is used to compare specified number of characters from two buffers
memicmp()
It is used to compare specified number of characters from two
buffers regardless of the case of the characters
memchr()
It is used to locate the first occurrence of the character in the
specified string
Ctype.h
Sr.No. Function & Description
1 int tolower(int c)This function converts uppercase letters to lowercase.
2 int toupper(int c)This function converts lowercase letters to uppercase.
Sr.No. Function & Description
1 int isalnum(int c)This function checks whether the passed character is alphanumeric.
2 int isalpha(int c)This function checks whether the passed character is alphabetic.
3 int iscntrl(int c)This function checks whether the passed character is control character.
4 int isdigit(int c)This function checks whether the passed character is decimal digit.
5 int isgraph(int c)This function checks whether the passed character has graphical
representation using locale.

More Related Content

Similar to Header file.pptx

The Ring programming language version 1.5.4 book - Part 35 of 185
The Ring programming language version 1.5.4 book - Part 35 of 185The Ring programming language version 1.5.4 book - Part 35 of 185
The Ring programming language version 1.5.4 book - Part 35 of 185Mahmoud Samir Fayed
 
C cheat sheet for varsity (extreme edition)
C cheat sheet for varsity (extreme edition)C cheat sheet for varsity (extreme edition)
C cheat sheet for varsity (extreme edition)Saifur Rahman
 
The Ring programming language version 1.7 book - Part 29 of 196
The Ring programming language version 1.7 book - Part 29 of 196The Ring programming language version 1.7 book - Part 29 of 196
The Ring programming language version 1.7 book - Part 29 of 196Mahmoud Samir Fayed
 
The Ring programming language version 1.8 book - Part 116 of 202
The Ring programming language version 1.8 book - Part 116 of 202The Ring programming language version 1.8 book - Part 116 of 202
The Ring programming language version 1.8 book - Part 116 of 202Mahmoud Samir Fayed
 
The Ring programming language version 1.5.3 book - Part 25 of 184
The Ring programming language version 1.5.3 book - Part 25 of 184The Ring programming language version 1.5.3 book - Part 25 of 184
The Ring programming language version 1.5.3 book - Part 25 of 184Mahmoud Samir Fayed
 
Lecture 15_Strings and Dynamic Memory Allocation.pptx
Lecture 15_Strings and  Dynamic Memory Allocation.pptxLecture 15_Strings and  Dynamic Memory Allocation.pptx
Lecture 15_Strings and Dynamic Memory Allocation.pptxJawadTanvir
 
The Ring programming language version 1.9 book - Part 123 of 210
The Ring programming language version 1.9 book - Part 123 of 210The Ring programming language version 1.9 book - Part 123 of 210
The Ring programming language version 1.9 book - Part 123 of 210Mahmoud Samir Fayed
 
Python 2.5 reference card (2009)
Python 2.5 reference card (2009)Python 2.5 reference card (2009)
Python 2.5 reference card (2009)gekiaruj
 
The Ring programming language version 1.5.4 book - Part 26 of 185
The Ring programming language version 1.5.4 book - Part 26 of 185The Ring programming language version 1.5.4 book - Part 26 of 185
The Ring programming language version 1.5.4 book - Part 26 of 185Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 126 of 212
The Ring programming language version 1.10 book - Part 126 of 212The Ring programming language version 1.10 book - Part 126 of 212
The Ring programming language version 1.10 book - Part 126 of 212Mahmoud Samir Fayed
 
The best every notes on c language is here check it out
The best every notes on c language is here check it outThe best every notes on c language is here check it out
The best every notes on c language is here check it outrajatryadav22
 
The Ring programming language version 1.10 book - Part 34 of 212
The Ring programming language version 1.10 book - Part 34 of 212The Ring programming language version 1.10 book - Part 34 of 212
The Ring programming language version 1.10 book - Part 34 of 212Mahmoud Samir Fayed
 
Python Strings Methods
Python Strings MethodsPython Strings Methods
Python Strings MethodsMr Examples
 
Stream Based Input Output
Stream Based Input OutputStream Based Input Output
Stream Based Input OutputBharat17485
 
String and string buffer
String and string bufferString and string buffer
String and string bufferkamal kotecha
 

Similar to Header file.pptx (20)

The Ring programming language version 1.5.4 book - Part 35 of 185
The Ring programming language version 1.5.4 book - Part 35 of 185The Ring programming language version 1.5.4 book - Part 35 of 185
The Ring programming language version 1.5.4 book - Part 35 of 185
 
C cheat sheet for varsity (extreme edition)
C cheat sheet for varsity (extreme edition)C cheat sheet for varsity (extreme edition)
C cheat sheet for varsity (extreme edition)
 
The Ring programming language version 1.7 book - Part 29 of 196
The Ring programming language version 1.7 book - Part 29 of 196The Ring programming language version 1.7 book - Part 29 of 196
The Ring programming language version 1.7 book - Part 29 of 196
 
The Ring programming language version 1.8 book - Part 116 of 202
The Ring programming language version 1.8 book - Part 116 of 202The Ring programming language version 1.8 book - Part 116 of 202
The Ring programming language version 1.8 book - Part 116 of 202
 
The Ring programming language version 1.5.3 book - Part 25 of 184
The Ring programming language version 1.5.3 book - Part 25 of 184The Ring programming language version 1.5.3 book - Part 25 of 184
The Ring programming language version 1.5.3 book - Part 25 of 184
 
Lecture 15_Strings and Dynamic Memory Allocation.pptx
Lecture 15_Strings and  Dynamic Memory Allocation.pptxLecture 15_Strings and  Dynamic Memory Allocation.pptx
Lecture 15_Strings and Dynamic Memory Allocation.pptx
 
Strings part2
Strings part2Strings part2
Strings part2
 
The Ring programming language version 1.9 book - Part 123 of 210
The Ring programming language version 1.9 book - Part 123 of 210The Ring programming language version 1.9 book - Part 123 of 210
The Ring programming language version 1.9 book - Part 123 of 210
 
Python 2.5 reference card (2009)
Python 2.5 reference card (2009)Python 2.5 reference card (2009)
Python 2.5 reference card (2009)
 
The Ring programming language version 1.5.4 book - Part 26 of 185
The Ring programming language version 1.5.4 book - Part 26 of 185The Ring programming language version 1.5.4 book - Part 26 of 185
The Ring programming language version 1.5.4 book - Part 26 of 185
 
The Ring programming language version 1.10 book - Part 126 of 212
The Ring programming language version 1.10 book - Part 126 of 212The Ring programming language version 1.10 book - Part 126 of 212
The Ring programming language version 1.10 book - Part 126 of 212
 
Lecture 8- Data Input and Output
Lecture 8- Data Input and OutputLecture 8- Data Input and Output
Lecture 8- Data Input and Output
 
Strings
StringsStrings
Strings
 
Managing I/O in c++
Managing I/O in c++Managing I/O in c++
Managing I/O in c++
 
The best every notes on c language is here check it out
The best every notes on c language is here check it outThe best every notes on c language is here check it out
The best every notes on c language is here check it out
 
The Ring programming language version 1.10 book - Part 34 of 212
The Ring programming language version 1.10 book - Part 34 of 212The Ring programming language version 1.10 book - Part 34 of 212
The Ring programming language version 1.10 book - Part 34 of 212
 
Control statements
Control statementsControl statements
Control statements
 
Python Strings Methods
Python Strings MethodsPython Strings Methods
Python Strings Methods
 
Stream Based Input Output
Stream Based Input OutputStream Based Input Output
Stream Based Input Output
 
String and string buffer
String and string bufferString and string buffer
String and string buffer
 

Recently uploaded

Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college projectTonystark477637
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)simmis5
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordAsst.prof M.Gokilavani
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdfankushspencer015
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduitsrknatarajan
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Christo Ananth
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
 

Recently uploaded (20)

Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduits
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 

Header file.pptx

  • 2. Sr.No. Header Files & Description 1 stdio.h Input/Output functions 2 conio.h Console Input/Output functions 3 stdlib.h General utility functions 4 math.h Mathematics functions 5 string.h String functions 6 ctype.h Character handling functions
  • 3. Sr.No. Functions & Description 1 printf() It is used to print the strings, integer, character etc on the output screen. 2 scanf() It reads the character, string, integer etc from the keyboard. 3 getc() It reads the character from the file. 4 putc() It writes the character to the file. 5 fopen() It opens the file and all file handling functions are defined in stdio.h header file. 6 fclose() It closes the opened file. 7 remove() It deletes the file. 8 fflush() It flushes the file.
  • 4. stdlib.h:Standard Library. It has the information of memory allocation/freeing functions. Function Description malloc() This function is used to allocate space in memory during the execution of the program. calloc() This function is also like malloc () function. But calloc () initializes the allocated memory to zero. But, malloc() doesn’t realloc() This function modifies the allocated memory size by malloc () and calloc () functions to new size free() This function frees the allocated memory by malloc (), calloc (), realloc () functions and returns the memory to the system. abs() This function returns the absolute value of an integer . The absolute value of a number is always positive. Only integer values are supported in C. div() This function performs division operation abort() It terminates the C program exit() This function terminates the program and does not return any value system() This function is used to execute commands outside the C program. atoi() Converts string to int atol() Converts string to long atof() Converts string to float strtod() Converts string to double strtol() Converts string to long getenv() This function gets the current value of the environment variable setenv() This function sets the value for environment variable putenv() This function modifies the value for environment variable perror() This function displays most recent error that happened during library function call. rand() This function returns the random integer numbers delay() This function Suspends the execution of the program for particular time
  • 5. Conio.h Functions Description clrscr() This function is used to clear the output screen. getch() This function is used to get a single character from keyboard without echo. textcolor() This function is used to define text color. Color code should be between 0 to 15 (0x00 to 0x0F) textbackground() This function is used to define background color of the text. Color code should be between 0 to 15 (0x00 to 0x0F)
  • 6. Math.h function Description Example sqrt(x) square root of x sqrt(4.0) is 2.0 sqrt(10.0) is 3.162278 exp(x) exponential (ex) exp(1.0) is 2.718282 exp(4.0) is 54.598150 log(x) natural logarithm of x log(2.0) is 0.693147 log(4.0) is 1.386294 log10(x) logarithm of x (base 10) log10(10.0) is 1.0 log10(100.0) is 2.0 fabs(x) absolute value of x fabs(2.0) is 2.0 fabs(-2.0) is 2.0 ceil(x) rounds x to smallest less than x ceil(9.2) is 10.0 ceil(-9.2) is -9.0 floor(x) rounds x to largest greater than x floor(9.2) is 9.0 floor(-9.2) is -10.0 pow(x,y) x raised to power y (xy) pow(2,2) is 4.0 fmod(x) remainder of x/y as number fmod(13.657, 2.333) is sin(x) sine of x (x in radian) sin(0.0) is 0.0 cos(x) cosine of x (x in radian) cos(0.0) is 1.0 tan(x) tangent of x (x in radian) tan(0.0) is 0.0
  • 7. String.h String functions Description strcat ( ) Concatenates str2 at the end of str1 strncat ( ) Appends a portion of string to another strcpy ( ) Copies str2 into str1 strncpy ( ) Copies given number of characters of one string to another strlen ( ) Gives the length of str1 strcmp ( ) Returns 0 if str1 is same as str2. Returns <0 if strl < str2. Returns >0 if str1 > str2 strcmpi ( ) Same as strcmp() function. But, this function negotiates case. “A” and “a” are treated as same. strchr ( ) Returns pointer to first occurrence of char in str1 strrchr ( ) last occurrence of given character in a string is found strstr ( ) Returns pointer to first occurrence of str2 in str1 strrstr ( ) Returns pointer to last occurrence of str2 in str1
  • 8. strdup ( ) Duplicates the string strlwr ( ) Converts string to lowercase strupr ( ) Converts string to uppercase strrev ( ) Reverses the given string strset ( ) Sets all character in a string to given character strnset ( ) It sets the portion of characters in a string to given character strtok ( ) Tokenizing given string using delimiter
  • 9. String functions Description memset() It is used to initialize a specified number of bytes to null or any other value in the buffer memcpy() It is used to copy a specified number of bytes from one memory to another memmove() It is used to copy a specified number of bytes from one memory to another or to overlap on same memory. memcmp() It is used to compare specified number of characters from two buffers memicmp() It is used to compare specified number of characters from two buffers regardless of the case of the characters memchr() It is used to locate the first occurrence of the character in the specified string
  • 10. Ctype.h Sr.No. Function & Description 1 int tolower(int c)This function converts uppercase letters to lowercase. 2 int toupper(int c)This function converts lowercase letters to uppercase.
  • 11. Sr.No. Function & Description 1 int isalnum(int c)This function checks whether the passed character is alphanumeric. 2 int isalpha(int c)This function checks whether the passed character is alphabetic. 3 int iscntrl(int c)This function checks whether the passed character is control character. 4 int isdigit(int c)This function checks whether the passed character is decimal digit. 5 int isgraph(int c)This function checks whether the passed character has graphical representation using locale.