# C++ Programming Code Examples

## C++ > Arrays and Matrices Code Examples

### Programming Code for Three Dimensional (3D) Array

Find Sum of First & Last digit of a number -
C program to input a number and find sum of first & last digit of the number using for loop. Input a number from user and store it in some variable say j. Find last digit of given number

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

Program Code to Reverse a Stack without -
C program, using iteration, reverses a stack content. Stack here is represented using a linked list. A linked list is an ordered set of data elements, each containing a link to its

C++ Programs to Implements D-ary-Heap -
Filling up 'heap' with the array. A Function to check if heap is empty. Function to get index parent of i. Function to get index of k th child of i. Function to find least element. Function

C program Copies one String into another -
Demonstrate multiple loop control variables. This is a testing of converge. Copies one string into another. It copies characters to both the ends, converging at the middle...

C Code Check Palindrome Using Recursion -
In this article we have shared two C programs to check if the input number is palindrome or not. 1) using while loop 2) using recursion. If a number 'remains same', even if we reverse its

Checks if an Directed Graph is Tree or Not -
A C++ Program to check whether an directed graph is tree or not. Graph is tree if it doesn't contain cycles. Pointer to an array containing adjacency lists. Returns true if there is a cycle

Calculates Sum of Odd and Even Numbers -
C program code find the sum of odd and even numbers from 1 to N. Take Number N upto which we have to find the sum as input. Using for loop take the elements one by one from 1