Found 26504 Articles for Server Side Programming

norm() function in C++ with Examples

Sunidhi Bansal
Updated on 17-Apr-2020 09:20:54

1K+ Views

In this article we will be discussing the working, syntax and examples of norm() function in C++ STL.What is norm()?norm() function is an inbuilt function in C++ STL, which is defined in header file. norm() function is used to get the norm value of a complex number.Norm value of a complex number is the squared magnitude of a number. So in simple words the function finds the squared magnitude of a complex number, including its imaginary and real number.Syntaxdouble norm(ArithmeticType num);ParametersThe function accepts following parameter(s) −num − The complex value which we want to work on.Return valueThis function returns ... Read More

max() function for valarray in C++

Sunidhi Bansal
Updated on 17-Apr-2020 09:19:05

298 Views

In this article we will be discussing the working, syntax and examples of valarray::max() function in C++ STL.What is a valarray?std::valarray is a class which is used for representing, modifying the array of values, which supports elements-wise mathematical operations.What is valarray::max()?std::valarray::max() function is an inbuilt function in C++ STL, which is defined in header file. This function returns the maximum value which is in the valarray container.If the valarray is empty then the result which is returned is unspecified.SyntaxV_array_name.max();ParametersThe function accepts no parameter(s) −Return valueThis function returns the maximum value of the valarray.ExampleInputvalarray arr = { 1, 2, 4, ... Read More

localtime() function in C++

Sunidhi Bansal
Updated on 17-Apr-2020 09:17:05

247 Views

In this article we will be discussing the working, syntax and examples of localtime() function in C++ STL.What is localtime()?localtime() function is an inbuilt function in C++ STL, which is defined in the header file. localtime() is used to convert the given time into the local time.This function uses a value referred by the timer and fill the value of the structure and it converts the value into the given local timezoneSyntaxlocaltime(time_t *timer);ParametersThe function accepts the following parameter(s) −timer − It is a pointer to objects which have the time_t type value.Return valueThis function returns a pointer pointing to ... Read More

exp2() function in C++ STL

Sunidhi Bansal
Updated on 17-Apr-2020 09:14:27

166 Views

In this article we will be discussing the working, syntax and examples of std::exp2() function for complex numbers in C++ STL.What is std::exp2()?std::exp2() function for complex numbers is an inbuilt function in C++ STL, which is defined in or header file. exp2() function is used for computing the binary exponential function that is the base-2 exponential function of a given number.This function returns either double, float or long double value which is .Syntaxexp2(double n); exp2(float n); exp2(long double n);ParametersThe function accepts the following parameter(s) −n − It is a value of the exponent.Return valueThis function returns the base-2 ... Read More

exp() function for complex number in C++

Sunidhi Bansal
Updated on 17-Apr-2020 09:11:23

771 Views

In this article we will be discussing the working, syntax and examples of std::exp() function for complex numbers in C++ STL.What is std::exp()?std::exp() function for complex numbers is an inbuilt function in C++ STL, which is defined in a header file. exp() function for complex numbers is the same like the normal exp() which is also an inbuilt function, defined in header file, used to find the exponential value of the input.This function is exponential of the complex number and returns the exponential of the complex number.Syntaxexp(complex num);ParametersThe function accepts the following parameter(s) −num − It is ... Read More

Point arbit pointer to greatest value right side node in a linked list in C++

sudhir sharma
Updated on 17-Apr-2020 09:11:14

147 Views

In this problem, we are given a linked list with a value, link pointer and an arbitrary pointer. Our task is to make the arbitrary pointer point to point the largest value which is on the right side of it in the linked list.Let’s take an example to understand the problem, Here, we can see the following arbitrary pointers of the linked list, which points to the greatest elements on the right side of the linked list.12 -> 76, 76 -> 54, 54 -> 8, 8 -> 41To solve this problem, we need to find the greatest element to the ... Read More

Error functions using cmath in C++

Sunidhi Bansal
Updated on 17-Apr-2020 09:09:03

326 Views

We are given the variable and the task is to find the probability of the variable using an error function available in C++ STL. This function is available in the cmath header file in C++.What is an Error function?Error function in mathematics is also known as Gauss error function which is denoted by erf(). It is a special function that is used in probability, statistic and partial differential equations for the calculation of error that can occur. It is defined as −There are two closely related error function −complementary error function − It is defined as erfc x = 1 ... Read More

Point Clipping Algorithm in Computer Graphics in C++

sudhir sharma
Updated on 17-Apr-2020 09:07:48

790 Views

Computer graphics deals with drawing images and graphics on a computer screen. Here, we treat the screen as a 2-D coordinate system. This coordinate system starts from top-left (0, 0) and ends at bottom-right.Viewing plane is the area defined for drawing graphics in computer graphics. Or the visible area of the screen.Clipping is deleting those points or graphics that are outside the viewing plane.Let's take an example to understand clipping.Here points C and D will be clipped as they are outside the viewing plane marked with blue color.In order to clip a point in computer graphics. We need to know ... Read More

count_if() in C++ STL

Sunidhi Bansal
Updated on 17-Apr-2020 09:03:55

1K+ Views

In this article we will be discussing the working, syntax and examples of std::count_if() function in C++ STL.What is std::count_if()?std::count_if() function is an inbuilt function in C++ STL, which is defined in header file. count_if() is used to get the number of elements in a specified range which satisfy a condition. This function returns an integer value which is the number of elements which satisfies the condition.The function not only iterates through the given range but also checks if the statement or condition is true and counts how many times the statement or condition was true and returns the ... Read More

Point to next higher value node in a linked list with an arbitrary pointer in C++

sudhir sharma
Updated on 17-Apr-2020 09:03:36

216 Views

In this problem, we are given a linked list with a value, link pointer and an arbitrary pointer. Our task is to make the arbitrary pointer point to point the next large value in the list.Let’s take an example to understand the problem, Here, we can see 8 points to 12, 12 to 41, 41 to 54, 54 to 76 which are successive larger elements of the linked list.To solve this problem, we will use the merge sort algorithm to sort elements and use the sort as a linked list for the arbitrary pointer.For this we will use the merge ... Read More

Advertisements