# C++ Programming Code Examples

## C++ > Beginners Lab Assignments Code Examples

### Simple Program for Exception Handling with Multiple Catch Using C++ Programming

Code Put Even and Odd elements of array - C program to input elements in an array and put all even and odd elements in 2 separate array. Separate even and odd elements of a given array in 2 separate array containing...

Checking the Number is a Perfect Number - Program input a number and check whether the number is Perfect number or not. Perfect number is a positive integer which is equal to the sum of its proper positive divisors. So 6 is

Swapping Two Numbers Without Variable - Imagine we have two number 1 and 2 stored in x and j respectively now. If we add x and j (1 + 2) and store it to x then x will become 3 and j is still 2. We subtract j (2) from new value of

Code Swap first and last digit of a number - C program to input a number from user and swap first and last digit of the given number. Input number from user, find last digit, find total number of digit - 1, find first digit. How

C Programming Language Median Sample - A 'median' value is the value at the center of a sorted list. To median we need to sort the list in ascending or descending order. The List of 3, 5, 2, 7, 3 as our input list, to find out median

Counting program code in The C language - Counting is sequence of whole numbers in ascending order without zero. Developing a program of counting in C language is easy and we shall see here in this chapter. Count

Program Compare two Strings by Pointers - C program to compare two strings using loop character by character. Logic to compare two strings. Input "2 strings" from user. Store it in some variable say str1 and str2. Compare two

C Coding Print all the Paths from the Root - C language program Function to store all the paths from the root node to all leaf nodes in a array. Function which helps the print_path to recursively print all the nodes. Function to...