# C++ Programming Code Examples

## C++ > Arrays and Matrices Code Examples

### Program to Find Transpose of a Matrix

Check Prime or Armstrong Number Using -
In this program, two User-Defined functions checkPrimeNum() & checkArmstrongNum() are created. The checkPrimeNum() returns 1 if the number entered by the user is a Prime

C++ Mathematic Code Add Two Numbers -
In this C++ program, user is asked to enter 2 integers. Then, the sum of those 2 integers is stored in a variable and 'displayed' on screen. The variables firstNumber & secondNumber

C program to Dynamic Array of structures -
Dynamic array of structures. Add ONE element to the array. Allocate memory for one 'struct node'. Copy the data into the new element (structure). Print the array. Free all...

Print Combination of 2 Words of 2 Strings -
Print combination of two words of two given strings without any repetition. Incrementing the count if the characters of the main string match with the characters of the given word.

Find the two Elements such that their Sum -
Initialize the array named array[] with the random values. Call function minabsvaluepair and pass array and its size as parameters. In the function definition receive parameters...

How to pass an entire array to a function -
Pointer var1 is pointing to the first element of the array and the var2 is the size of the array. In the loop we are incrementing pointer so that it points to the next element of the array

Inputs Few Numbers Performs Merge Sort -
Input few numbers & perform 'Merge Sort' on them using recursion. C program to performs merge sort. Merge sort is a sorting algorithm with complexity of O(nlogn) and It is used for

C++ Codings Find the Maximum Subarray -
Implement the 'naive method' to find the sub array having a maximum sum. The worst case time 'Complexity' of the algorithm is 'O(n*n)'. Take the input of the 'integer array'. Compare