# C++ Programming Code Examples

## C++ > Pyramid Patterns Code Examples

### Print Dimond of Star

C++ Programming Code Check Leap Year -
Program checks whether an year ("integer") entered by the user is a leap year or not. All years which are "perfectly divisible" by 4 are leap years except for century years which is

C++ Find Minimum Element Linear Search -
First 'Compare the Element' at the beginning with another array element sequentially. And swap values if the element at the beginning is Larger than the other element. This value will

Sorting Elements in Lexicographical Order -
C Language program code 'Sort Elements' in lexicographical order (dictionary order). This program takes 10 words(10 strings) from the user and sorts them in lexicographical order.

Program to calculate Average of array in C -
This C program should give an insight of how to parse (read) array. We shall use a loop and Sum up all Values of the array. Then we shall divide the sum with the number of elements

Converts Decimal Number to Octal in C++ -
In the program, the decimal number is stored in the variable decimalNumber and passed to function decimalToOctal(). Function converts the 'decimal number' passed to its equivalent

Compute to difference between two dates -
C Programming code sample to compute difference between two dates. Enter first day, month, year. No. of days of first date from the Jan 1. Count for additional days due to...

Find the Type of the Triangle made by i-p -
Program to find the type of the triangle made by i-p values of its coordinates of its vertices. Enter coordinates of vertex A, B, C. Triangle made by these vertices is an equilateral...

Program Code to Implement Linear Search -
C implements 'Linear Search'. Linear search is also called as sequential search. Linear search is a method for Finding a Particular value in a list, that consists of checking every one of its