# C++ Programming Code Examples

## C++ > Mathematics Code Examples

### program to find Fibonacci Series with understanding logic

C Code to find largest element of an Array -
Function to find the largest element in the array. In the following program we are initializing a variable (maxelement) with the first element of given array and then we are

C++ Codes String Matching in Linear Time -
Create the Shift-Lookup-Table. Start with the second character, since the shift to the first is always 0. Search the "string" and return when the first occurrence is found. Searching string

C Coding Print all the Paths from the Root -
C language program Function to store all the paths from the root node to all leaf nodes in a array. Function which helps the print_path to recursively print all the nodes. Function to...

Swapping Two Numbers Without Variable -
Imagine we have two number 1 and 2 stored in x and j respectively now. If we add x and j (1 + 2) and store it to x then x will become 3 and j is still 2. We subtract j (2) from new value of

C programming Open and Copy Functions -
Open a source file. If there is an error giving message: Cannot open source file. Open destination file. If there is error give message: Cannot open destination file. If file won't

Assignment Operators in The C Language -
C Programming to assignment operators. An Assignment Operator is used for assigning a value to a variable. C code demonstrate the working of assignment operators. The most

Mathematic Functions Calculate Percentile -
The array of integers indicating the marks of the students is given, U have to calculate the percentile of the students aaccording to this rule: the percentile of a student is the %of no

C Evaluate the Given Polynomial Equation -
C program to evaluate a given polynomial by reading its coefficients in an array. Formula is P(x)=AnXn + An-1Xn-1 + An-2Xn-2+... +A1X + A0. The 'polynomial' can be written as: P(x) =