# C++ Programming Code Examples

## C++ > If Else and Switch Case Code Examples

### The if-else Ladder/else-if Clause

Code Get Highest Order Set Bit of Number -
Highest position of a set bit from left to right in a number is said to be highest order set bit of that number. Highest order set bit of any negative integers is 31. Since, highest order...

Implementations for Pairing Heap in C++ -
"Change the Value" of the item stored in the pairing heap. Does nothing if newVal is larger than currently stored value. p points to node returned by insert. "newVal" is the new value

C Program Checking Armstrong Numbers -
Check for Armstrong Number in C language. Armstrong Number: If sum of cubes of digits of number equal to same given number then the number is called as Armstrong Number.

C coding to Accessing 2-D Array Elements -
Program code to access every 2-D Array we requires 2 subscript variables. y - Refers the Row number. x - Refers Column number. a[1][0] refers element belonging to first row

Using Insertion Sort Technique in The C++ -
To sort an array using insertion sort, enter the array size and then array elements in random order. Start Sorting the Elements of the array in Ascending Order using insertion sort as like

C Program Coding Multiply Two Numbers -
Stores two floating point numbers in variable firstNumber and secondNumber respectively. Performs multiplication and stores the result in variable productOfTwoNumbers. Result up

Find sum of array elements using pointers -
C Program code find sum of array elements using pointers, recursion & functions. Sum of array elements using Recursion: Function calling itself. This program calls user defined

Perform Unique Factorization of Numbers -
Program finds the Unique paritions of a given integer such that addition of a partition result an integer. A positive integer n, "generate" all possible unique ways to represent n as sum of