# C++ Programming Code Examples

## C++ > Arrays and Matrices Code Examples

### Program to Count Inversion in an Array

C++ Programming Simple Stack Program -
A "stack" is a basic data structure and can be defined in an abstract, implementation-free manner, or it can be generally "defined" as a linear list of items in which all additions and

C Codes Implement Recalibrate Command -
Check whether the FDC is ready. Read status of main status register. Check whether FDC is ready. Input the command parameters. Enter command parameters. Check the status of...

Add 2 Distances System Using Structures -
A "Structure Distance" containing two data members (inch and feet) is declared to store the distance in inch-feet system. Here, two structure variables d1 and d2 are created to

Calculate the Sum of the Elements of each -
Program code take the MxN matrix as input. Define two functions separately for row sum and column sum. Use for loops to calculate the sum of the elements of each row and...

C Program Insertion Sort implementations -
'Insertion Sort Algorithm' picks elements one by one & places it to the right position where it belongs in the "Sorted List of Elements". In C program we have "implemented the same"

Multiply Two Matrix by Multi Dimensional -
In this program, "enter the size "of 2 matrix at first. To multiply two matrices, the number of columns of first matrix should be equal to the "number of rows" to second matrix. C++ Code

C++ Programing Implement String in STL -
'Insert substring' in a string. 'Erase substring' from a string. 'Append substring' to a string. Replace the string with a substrng. Size of a string. Find substring in a string. Display the

Simple Calculator using Switch Statement -
This C Program takes an arithmetic operator +, -, *, / and two operands from the user and Performs the Calculation on the 2 operands depending upon the operator entered by the