You are on page 1of 10

LIBRARY FUNCTIONS

Trigonometric functions Hyperbolic Functions Mathematical Functions String Functions Miscellaneous Functions

TRIGONOMETRIC FUNCTIONS
acos(x) asin(x) atan(x) atan(x) cos(x) sin(x) tan(x)

- Arc cosine of x i.e. cos-1x - Arc sine of x i.e. sin-1x - Arc tangent of x i.e. tan-1x - Arc tangent of x i.e. tan-1(x/y) - cosine of x i.e. cos x - sine of x i.e. sin x - tangent of x i.e. tan x

HYPERBOLIC FUNCTIONS
Used to solve hyperbolic expressions cosh(x) - hyperbolic cosine of x sinh(x) - hyperbolic sine of x tanh(x) - hyperbolic tangent of x

MATHEMATICAL FUNCTIONS
abs(x) sqrt(x) fabs(x) pow(x,y) log(x) log 10(x) exp(x) fmod(x,y)

- to find absolute value of x - to find square root of x - to find absolute value in float - computes to exponential xy form - returns natural logarithm of x - returns logarithm value having base 10and x>0 - finds ex. The result will be in double - remainder of x/y

STANDARD IN-BUILD STRING FUNCTIONS


All these function are defined in header file called <string.h> Strlen :-determines length of string eg-char str[7]=sanjima; strlen(str); Strcpy :-copies a string from source to destination
eg- strcpy(str,Judas Priest);

Strncpy:-copies char of string to another string upto specific length


eg- strcpy(cStr1,Judas Priest,5);

Strcmp:-compare char of 2 strings(discrimination b/w small capital letters) and returns an integer value strcmp(madonna,maradona); Stricmp:-compare 2 strings strings(no discrimination b/w small and capital letters)

and

Strncmp:-compare char of 2 strings upto specific length Strnicmp:-compare char of 2 strings upto specific length .Ignore case. Strlwr:-converts upper case characters to lower case Strupr:- converts lower case characters to upper case Strrev :-reverse all the characters of the string
Eg- char a[]=java ; strrev(a);

Strcat:-append source string to destination string strcat(sanjima, ABC);

MISCELLANEOUS
ceil(x) - x is rounded upto the nearest integer not less than x floor(x) - x is rounded upto the nearest integer less than x toascii(x) - converts any character or numeric value to an ascii value toupper(c) -converts any single character into upper case tolower(c) -converts any single character to lower case getchar() -used to get or read the input (i.e a single character) at run time. During the program execution, a single character is get or read through the getchar(). The given value is displayed on the screen and the compiler wait for another character to be typed. If you press the enter key/any other characters and then only the given character is printed.

getche() - used to get a character from console, and echoes to the screen. During the program execution, a single character is get or read through the getche(). The given value is displayed on the screen and the compiler does not wait for another character to be typed. getch() - used to get a character from console, and does not echoes to the screen. During the program execution, a single character is get or read through the getch(). The given value is not displayed on the screen and the compiler does not wait for another character to be typed.

If x= -5.4, y= fabs(x) then y =5.4 If x=2.2, y=ceil(x) then y=3 If x=2.2, y=floor(x) then y=2

You might also like