C++ Programming Code Examples
C++ > Data Structures Code Examples
C Program Code Merge Two Sorted Array
C program to read elements in two array and merge elements of two array into third array. Elements of array can be merged either in ascending order or in descending order in C.
C++ Program to Implement Selection Sort
This C++ program sample sort the given data using Selection Sort. Selection sort algorithm sort data by comparing one element to every other element & decide its position. The time
Find the Length of Strings without strlen()
We are Counting the Number of characters in a given String to find out & display its Length on console. Upon 'execution' of this program, the user would be asked to enter string, then
Compare two Strings in the C++ language
Function will return 0, if the strings are equal; return 'negative value', if "string1 is less" than string2 and return "positive value" if string1 is greater than string2. This function 'compares'
Program to Find number of Days in month
Program code enter Month number between 1-12 and print number of days in month using If Else. Input month number from user. Store it in a variable say month and for each month
Checks a Character is Vowel or Consonant
The five alphabets 'A, E, I, O and U' are called 'vowels'. All other alphabets except these five vowel letters are called consonants. Program above assumes that the user always enters an
Inheritance Allow Child Classes to Acquire
A class that inherits another class is known as child class, it is also known as derived class or subclass. What is parent class? The class that is "being inherited" by other class is known as
Code Finds the Median of 2 Sorted Arrays
Algorithm finds the median of 2 sorted arrays using binary search approach. Takes the input of 'n' Data Elements of both the arrays. Using decrease, conquer method find the combined