# C++ Programming Code Examples

## C++ > Conversions Code Examples

### Convert Hexadecimal to Octal

Finds Independent Sets in Graph by Graph - Code finds 'largest independent' set by graph coloring. 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 set I

Print stuff to a File Reading the number of - Write a c programming example to print stuff to a file reading the number of time for an other file. Program code to read the number from a file. Program code to write to the file.

Find Nth Fibonacci Number Use Recursion - C Program to find the nth 'fibonacci number' using recursion. Program prints the fibonacci of a number. In fibonacci series, each number is the sum of the 2 preceding numbers. 0, 1, 1,

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'

A destructor is a Special Member Function - In C++, Name should begin with tilde sign(~) and must match class name. There cannot be more than one "Destructor" in a class. Unlike "constructors" that can have parameters, and

C++ Swap Two Numbers Using 3. Variable - Swap numbers means exchange the values of two variables with each other. Variable num1 contains 20 and num2 contains 40 after swap there values num1 contains 40 num2 contains

Program to Find Inverse of a Graph Matrix - C++ code displays the Gauss Jordan method of computing inverse of a matrix. it proceeds with row by row "reduction of matrix" to unit matrix column-wise. First enter the order of

Function strncpy Copies First n Characters - If 'Length of str2' > n then it just copies first n characters of str2 into str1. If Length of str2 < n then it 'copies' all the characters of str2 into str1 & appends several 'terminator' chars('\0')