C++ Programming Code Examples
C++ > Code Snippets Code Examples
Find the first of any of these chars
Program to Swap Numbers in Cyclic Order -
Notice that we have not returned any values from the 'cyclicSwap()' function. When these variables are swapped in "Cyclic Order" in the 'cyclicSwap()' function, variables a, b and c in
Finds Size of the Largest Independent Set -
Program to find largest independent set in a binary tree. In graph theory, an independent set or stable set is a set of vertices in a graph, no two of which are 'adjacent'. That is, it is a
Find the Common Ancestor and Print Path -
C Create temporary node. Create the binary search tree. Display the preorder traversal of the tree. Find common ancestor for given nodes. Find whether given nodes are present
C Calculate Total Average and Percentage -
Input marks of five subjects of a student and calculate total, average and percentage of all subjects. Calculate total average percentage in C programming. Find total, average and...
C Calculates Area of an Equilatral Triangle -
An "Equilateral Triangle" has equal sides (all 3 sides are equal). In order to calculate the area of equilateral triangle, we must know the side of the triangle. This C program would prompt
Strrchr searches the string in reverse order -
'StrrChr' is similar to the function 'StrChr', the only difference is that it searches the string in "Reverse Order", would have understood why we have extra r in 'strrchr', yes you guessed it
C Language Codes & Arithmetic Operators -
Arithmetic operator performs mathematical operations such as addition, subtraction and multiplication on numerical values (constants and variables). C Program to demonstrate...
Implementing Hash Table Double Hashing -
Genereate first "Hash" and genereate second hash. Initialize table and "Find" element from the table. Function to insert element into the table. Function to rehash the table. Retrieve