atanh Function in C++ STL

Ankith Reddy
Updated on 24-Jun-2020 10:55:29

182 Views

The atanh() function returns the arc hyperbolic tangent or the inverse hyperbolic tangent of an angle given in radians. It is an inbuilt function in C++ STL.The syntax of the atanh() function is given as follows.atanh(var)As can be seen from the syntax, the function atanh() accepts a parameter var of data type float, double or long double. The value of this parameter should be between -1 and 1. It returns the arc hyperbolic tangent of var.A program that demonstrates atanh() in C++ is given as follows.Example Live Demo#include #include using namespace std; int main() {    double d = ... Read More

Pre-Increment or Pre-Decrement in C

karthikeya Boyini
Updated on 24-Jun-2020 10:54:34

2K+ Views

Increment operators are used to increase the value by one while decrement works opposite increment. Decrement operator decreases the value by one.Here is the syntax of pre-increment operator in C language, ++variable_name;Here is the syntax of pre-decrement operator in C language, --variable_name;Let us see the difference between pre-increment and pre-decrement operator.Pre-increment − Before assigning the value to the variable, the value is incremented by one.Here is an example of pre-increment in C language, Example Live Demo#include int main() {    int i = 5;    printf("The pre-incremented value : %d", i);    while(++i < 10 )    printf("%d\t", i);   ... Read More

Tanh Function in C++ STL

George John
Updated on 24-Jun-2020 10:54:11

165 Views

The tanh() function returns the hyperbolic tangent of an angle given in radians. It is an inbuilt function in C++ STL.The syntax of the tanh() function is given as follows.tanh(var)As can be seen from the syntax, the function tanh() accepts a parameter var of data type float, double or long double. It returns the hyperbolic tangent of var.A program that demonstrates tanh() in C++ is given as follows.Example Live Demo#include #include using namespace std; int main() {    double d = 5, ans;    ans = tanh(d);    cout

ACOSH Function in C++ STL

Chandu yadav
Updated on 24-Jun-2020 10:53:32

183 Views

The acosh() function returns the arc hyperbolic cosine or the inverse hyperbolic cosine of an angle given in radians. It is an inbuilt function in C++ STL.The syntax of the acosh() function is given as follows.acosh(var)As can be seen from the syntax, the function acosh() accepts a parameter var of data type float, double or long double. The value of this parameter should be greater than or equal to 1. It returns the arc hyperbolic cosine of var.A program that demonstrates acosh() in C++ is given as follows.Example Live Demo#include #include using namespace std; int main() {    double ... Read More

Variables and Keywords in C

Samual Sam
Updated on 24-Jun-2020 10:52:39

12K+ Views

VariablesIn C language, variables are the storage place where some form of data is stored. Different variables require different amount of memory on which a set of operations is applied.A variable name cannot start with a number. It can consist of alphabets, number, underscore “_”.Here is the syntax of declaring variables in C language, type variable_name;Here is the syntax of multiple variables declaration in C language, type variable_name1, variable_name2, variable_name3;The following is an example of variables in C language, Example Live Demo#include int main() {    char a1 = 'H';    int b = 90, c = 150;    float ... Read More

strchr Function in C++

Chandu yadav
Updated on 24-Jun-2020 10:49:57

452 Views

In C++, strchr() is a predefined function. It is used for string handling and it returns the first occurance of a given character in the string provided.The syntax of strchr() is given as follows.char *strchr( const char *str, int c)In the above syntax, str is the string that contains the character c. The strchr() function finds the first occurrence of c in str.A program that demonstrates the strchr() function is given as follows.Example Live Demo#include #include using namespace std; int main() {    char str[] = "strings";    char * c = strchr(str,'s');    cout

strcat vs strncat in C++

Arjun Thakur
Updated on 24-Jun-2020 10:49:31

741 Views

Both strcat() and strncat() are predefined string functions in C++. Details about these are given as follows.strcat()This function is used for concatenation. It appends a copy of the source string at the end of the destination string and returns a pointer to the destination string. The syntax of strcat() is given as follows.char *strcat(char *dest, const char *src)A program that demonstrates strcat() is given as follows.Example Live Demo#include #include using namespace std; int main() {    char str1[20] = "Mangoes are ";    char str2[20] = "yellow";    strcat(str1, str2);    cout

strncat in C++

Ankith Reddy
Updated on 24-Jun-2020 10:49:01

562 Views

The function strncat() in C++ is used for concatenation. It appends the specified number of characters from the source string at the end of the destination string and returns a pointer to the destination string. The syntax of strncat() is given as follows.char * strncat ( char * dest, const char * src, size_t num );In the above syntax, the source string src is appended at the end of the destination string dest till num characters only.A program that demonstrates strcat() is given as follows.Example Live Demo#include #include using namespace std; int main() {    char str1[20] = "Programming ... Read More

strpbrk in C++

George John
Updated on 24-Jun-2020 10:47:19

333 Views

This is a string function in C++ that takes in two strings and finds the first occurrence of any character of string2 in string1. It returns the pointer to the character in string1 if there is any, otherwise returns NULL. This is not applicable for terminating NULL characters.The syntax of strpbrk() is given as follows −char *strpbrk(const char *str1, const char *str2)In the above syntax, strpbrk() returns the pointer to the first character in str1 that matches any character in str2.A program that demonstrates strpbrk() is given as follows.Example Live Demo#include #include using namespace std; int main() {   ... Read More

Multiply Two Matrices by Passing Matrix to Function in C++

Ankith Reddy
Updated on 24-Jun-2020 09:55:04

2K+ Views

A matrix is a rectangular array of numbers that is arranged in the form of rows and columns.An example of a matrix is as follows.A 3*4 matrix has 3 rows and 4 columns as shown below.8 6 3 5 7 1 9 2 5 1 9 8A program that multiplies two matrices by passing the matrices to functions is as follows.Example Live Demo#include using namespace std; void MatrixMultiplication(int a[2][3],int b[3][3]) {    int product[10][10], r1=2, c1=3, r2=3, c2=3, i, j, k;    if (c1 != r2) {       cout

Advertisements