Library Function
C++ provides many built-in functions that save the programming time. They include mathematical functions, character functions, string functions, and console input-output functions.
Mathematical Function
Some of the important mathematical functions in header file math.h are
Function Meaning
sqrt(x) Square Root of X
pow(x, y) x raised to the power y
sin(x) Sine of an angle x (measured in radians)
cos(x) Cosine of an angle x (measured in radians)
tan(x) Tangent of an angle x (measured in radians)
asin(x) Sin-1(x) where x (measured in radians)
acos(x) Cos-1(x) where x (measured in radians)
exp(x) Exponential function of x (ex)
log(x) Logarithm of x
log 10(x) Logarithm of number x to base 10
abs(x) Absolute value of integer number x
fabs(x) Absolute value of real number x
Character Function
Some of the important mathematical functions in header file ctype.h are
Function Meaning
isalpha(c) It returns True if C is an uppercase letter and false if c is lowercase.
isdigit(c) It returns True if c is a digit (0 to 9) otherwise false
isalnum(c) It returns True if c is digit from 0 through 9 or an alphabetic character
(either uppercase or lowercase) otherwise false
islower(c) It returns True if c is a lowercase letter otherwise False
isupper(c) It returns True if c is a uppercase letter otherwise False
String Function
Some of the important mathematical functions in header file string.h are
Function Meaning
strlen(s) It gives the no. of characters including spaces present in a string s.
strcat(s1, s2)
It concatenates the string s2 onto the end of the string s1. The
string s1 must have enough locations to hold s2.
strcpy(s1, s2)
It copies character string s2 to string s1. The s1 must have enough
storage locations to hold s2.
Console I/O Function
Some of the important mathematical functions in header file stdio.h are
Function Meaning
getchar()
It returns a single character from a standard input device (keyboard). It takes
no parameter and the returned value is the input character.
putchar() It takes one argument, which is the character to be sent to the output device.
C++ provides many built-in functions that save the programming time. They include mathematical functions, character functions, string functions, and console input-output functions.
Mathematical Function
Some of the important mathematical functions in header file math.h are
Function Meaning
sqrt(x) Square Root of X
pow(x, y) x raised to the power y
sin(x) Sine of an angle x (measured in radians)
cos(x) Cosine of an angle x (measured in radians)
tan(x) Tangent of an angle x (measured in radians)
asin(x) Sin-1(x) where x (measured in radians)
acos(x) Cos-1(x) where x (measured in radians)
exp(x) Exponential function of x (ex)
log(x) Logarithm of x
log 10(x) Logarithm of number x to base 10
abs(x) Absolute value of integer number x
fabs(x) Absolute value of real number x
Character Function
Some of the important mathematical functions in header file ctype.h are
Function Meaning
isalpha(c) It returns True if C is an uppercase letter and false if c is lowercase.
isdigit(c) It returns True if c is a digit (0 to 9) otherwise false
isalnum(c) It returns True if c is digit from 0 through 9 or an alphabetic character
(either uppercase or lowercase) otherwise false
islower(c) It returns True if c is a lowercase letter otherwise False
isupper(c) It returns True if c is a uppercase letter otherwise False
String Function
Some of the important mathematical functions in header file string.h are
Function Meaning
strlen(s) It gives the no. of characters including spaces present in a string s.
strcat(s1, s2)
It concatenates the string s2 onto the end of the string s1. The
string s1 must have enough locations to hold s2.
strcpy(s1, s2)
It copies character string s2 to string s1. The s1 must have enough
storage locations to hold s2.
Console I/O Function
Some of the important mathematical functions in header file stdio.h are
Function Meaning
getchar()
It returns a single character from a standard input device (keyboard). It takes
no parameter and the returned value is the input character.
putchar() It takes one argument, which is the character to be sent to the output device.
Function in C++
Reviewed by Unknown
on
04:24
Rating:
No comments: