# C++ Programming Code Examples

## C++ > Pyramid Patterns Code Examples

### C++ Program to print Alphabet Pattern

Finds the Frequency of the Word in String -
Take any Sentence as input and store it in the array 'string[]'. If the input string has 't', 'h', 'e' and ' ' Consecutively, then store that values in the variables 't, h, e & space' respectively. Use

Replace last Occurrence of a Character in a -
How to replace last occurrence of a character with another character in a given string using functions in 'C Language'. Input a string from user, store it in some variable say 'str'. Input a

Bitwise operators are used in C Language -
C Program Code Bitwise operators During computation, mathematical operations like: addition, subtraction, addition and division are converted to bit-level which makes and

Implement Graham Scan Algorithm Finds -
This is a C++ Program to implement Graham Scan algorithm. 'Graham's scan' is a method of computing the convex hull of a finite set of points in the plane with time complexity O(n

Program Finds the Peak Element of Arrays -
Implement the binary search to find a peak in the array. If the 'middle element' is more than its both Neighbors, 'it is the Peak'. Otherwise, split the array and check the same. A function

C Finds All Roots of A Quadratic Equation -
Step by step descriptive logic to find roots of Quadratic Equation using Switch Case. Input coefficients of quadratic equation. Store it in some variable say a, b, c. Find discriminant of

C++ Coding Sorts a Data using Heap Sort -
Heap sort is comparison based algorithm. It's selection sort sample. The time complexity is O(n*log(n)). Build a max heap using the given data element. And then Delete the root node

C Sum of the Main and Opposite Diagonal -
C Program code finds the sum of the main & opposite diagonal elements of a MxN Matrix. The program accepts an MxN matrix. Then adds main diagonal of matrix as well as the