# C++ Programming Code Examples

## C++ > Conversions Code Examples

### Convert Hexadecimal to Binary

Triangle is Valid or not if Angles are given -
C Program code to check whether a Triangle is valid or not if angles are given using if else. Input all three angles of triangle in a variable say angle1, angle2 and angle3. Find sum of...

Program code to Find the Size of a Union -
C Define the union named sample. Declare three variables m, n and ch of different data types. Use the keyword sizeof() to find the size of a union and print the same. Initialize

Sort Array in Ascending Descending Order -
Program code to read elements in an array and sort elements of the array in ascending order. Read unsorted integer values in array and sort them in ascending order. Numerous

Construct a Random Graph by the Method -
Generates a undirected random graph for the given number "edges and vertexes". The time complexity of this algorithm is O(v*e). Takes the input of the number of vertexes & edges

C Program Codes Finds Area of Trapezium -
C Language program to calculates the area of trapezium. The Formula used in this program are Area = (1/2) * (x + y) * h where x and y are the Two Bases of Trapezium & h is the height.

Add 2 Distances System Using Structures -
A "Structure Distance" containing two data members (inch and feet) is declared to store the distance in inch-feet system. Here, two structure variables d1 and d2 are created to

Program Code Demonstrate Nested Printf -
Print to 'abcdefghijklmnopqrstuvwxyz' while executing inner printf. Length of the "abcdfg hijklmnopqrstuvwxyz" is 26. Printf will return Length of String. It returns 26 to outer printf

Add Two Matrix Multi-Dimensional Arrays -
In this program, user is asked to entered the number of rows r and columns c. The value of r and c should be less than 88 in this program. The user is asked to enter elements of two...