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.